Lab_PSUC_List of Experiments (1)
Lab_PSUC_List of Experiments (1)
Lab Experiments
1 Algorithms and Flow Charts Describe the flowcharts and design of an algorithm
7 Control Structures: Nested Loops Choose the loop statements to solve the problem
1. To multiply to numbers.
2. To divide two numbers.
3. To check whether the given number is even or odd.
4. To swap two numbers.
5. To check whether the given number is lesser than 10 or not.
6. To convert Fahrenheit to Celsius.
7. To check the greater number in the given two numbers.
8. To calculate simple interest.
9. To check whether the given number is prime or not.
10. To calculate area of the given rectangle.
7. Write a program to calculate the amount of an electricity bill for the following criteria.
(Without Loop)
Units charge per unit (Rs.)
First, 1-100 up to 0
Next, 101-200 up to 1.5
Next, 201-400 up to 2.5
401 onwards 3.5
8. Write a program to calculate the discount in rupees for the following criterion. (Without Loop)
Cost price discount
>=800 25%
500-800 20%
<500 no discount (0%)
1. Write a program to take N as input and print the odd numbers in descending order.
2. Write a program to print the Fibonacci number.
Hint: (Fibonacci series is 0, 1, 1, 2, 3, 5, 8,)
3. Write a program to find whether the given number is prime or not.
4. Write a program to convert the decimal number into
binary to decimal. Ex: 1101 = 1*2 3 + 1 * 2 2 + 0 *
2 1+ 1* 2 0 =13
5. Write a program to reverse a given number
Ex: 1234 reverse=4*10 3 +3 * 10 2 + 2 * 10 1 + 1 * 10 0 =4321
6. Write a program to find the sum of n terms of the sin series sin(x) = x - x3 + x5 – x7
7. Write a program to check whether a given integer no. is palindrome or not.
8. Write a program to check whether the given number is Armstrong or not. An
Armstrong number of three digits is an integer such that the sum of the cubes of
its digits is equal to the number itself. For example, 371 is an Armstrong
number since 33 + 73 + 13 = 371.
1
2 2
3 3 3
4 4 4 4
5 5 5 5 5 5
5 5 5 5 5
4 4 4 4
3 3 3
2 2
1
1
2 4
3 5 7
6 8 10 12
9 11 13 15 17
5. Write a program to generate the multiplication table for n numbers up to k terms (nested
loops).
6. Write a program to print the Fibonacci numbers that fall in the given range.
7. Write a program to print the Nth the prime number.
8. Write a program to print the Nth the Armstrong number.
58 24 13 15 63 9 8 81 1 78
After splitting:
58 24 13 15 63
9 8 81 1 78
1. Write a program to change all lower-case letters into upper case in a sentence.
2. Write a program to find the last occurrence of a particular character.
3. Write a program to concatenate/length/copy two strings using the library function.
4. Write a program to count the number of words in a sentence.
5. Write a program to reverse a string.
6. Write a program to find the string length of a string without using the predefined function.
7. Write a program to find the substring of a given string.
8. Write a program to check if the given string is a palindrome or not.
1. Write a program to define a structure personal that would contain the person’s name, date of
joining, and salary. Using this structure write a program to read this information for one person
from the keyboard and print the same on the screen.
2. Write a program to create an array of student structures to store the roll no., name, and marks in
3 subjects. Input the details of N students into the array and display roll no., name, and total
marks of each student in decreasing order of total marks.
3. Write a program to create an array of employee structures to store emp-no, name, basic salary,
and HRA. Input the details of N employees and display emp-no, name, basic, HRA, and net
salary. Display the details of all employees whose net salary is more than the average net salary
of all employees.
4. Write a program to create a structure named Date having day, month, and year as its elements.
Store the current date in the structure. Now add 45 days to the current date and display the final
date.