Basic Programs

1. WAP to read radius of circle and calculate Area and Circumference

Input:
Enter radius: 5
Output:
Area of circle is 78.5
Circumference of circle is 31.5


2. WAP to read 3 numbers and find their mean

Input:
Enter number 1: 5
Enter number 2: 6
Enter number 3: 7
Output:
Mean of 5, 6 and 7 is 6


3. WAP to read 2 numbers and find Sum of their last digit

Input:
Enter number 1: 52
Enter number 2: 65
Output:
2 + 5 = 7


4. WAP to read 4-digit number and sum of its digits

Input:
Enter a number: 1234
Output:
1 + 2 + 3 + 4 = 10


5. WAP to read radius of Sphere and find its Volume

Input:
Enter radius: 5
Output:
Volume of sphere having radius 5 is 523.6


6. WAP to read 3-digit number and sum of its digits

Input:
Enter a number: 123
Output:
1 + 2 + 3 = 6


7. WAP to read 4-digit number and find reverse of that number

Input:
Enter a number: 1234
Output:
Reverse of 1234 is 4321


8. WAP to read temperature in Celsius and convert it into Fahrenheit

Input:
Enter temperature in Celsius: 38
Output:
Temperature in Fahrenheit is 100.4


9. WAP to read value in inches and print it in feet and inches

Input:
Enter length in inches: 20
Output:
20 inches is equal to 1 foot and 8 inches


10. WAP to read marks of 5 subjects and print total and percentage

Input:
Enter marks for Maths: 50
Enter marks for Science: 50
Enter marks for History: 50
Enter marks for English: 50
Enter marks for Marathi: 50
Output:
Total Marks: 250
Percentage: 50%


11. WAP to read 2 numbers and exchange their values using third variable

Input:
Enter value for x: 5
Enter value for y: 6
Output:
After swapping value of x is 6 and value of y is 5


12. WAP to read 2 numbers and exchange their values without using third variable

Input:
Enter value for x: 5
Enter value for y: 6
Output:
After swapping value of x is 6 and value of y is 5


13. WAP to read Length, Breadth and Height and find its volume and surface area

Input:
Enter length: 5
Enter breadth: 6
Enter height: 7
Output:
Volume of box is 210
Surface area of box is 214

One Reply to “Basic Programs”

Leave a Reply

Your email address will not be published. Required fields are marked *