Exercise: Arithmetic Operators

1. WAP to input two numbers and find sum.
2. Solution:

3. WAP to input two numbers and find multiplication.
4. Solution:

5. WAP to input number and calculate its square and cube.
6. Solution:

7. WAP to input length and breadth of a rectangle and calculate its area. Area=Length*Breadth.
8. Solution:

9. WAP to input radius and calculate area of circle and circumference of a circle. Area of circle = 3.14*r*r, Circumference of circle = 2*3.14*r
10. Solution:

11. WAP to input radius and height of a cylinder and calculate volume of cylinder. Volume=3.14*r*r*h
12. Solution:

13. WAP to input principal, rate, time and calculate Simple Interest. Simple Interest=Principal*Rate*Time/100.
14. Solution:

15. WAP to Input 5 subject marks of a student and find total marks and percentage obtained by the student.
16. Solution:

17. WAP to convert temperature from Fahrenheit to Celsius. C=(F-32)*5/9.
18. Solution:

19. WAP to convert temperature from Celsius to Fahrenheit. F=C*9/5+32.
20. Solution:

21. WAP to Input two numbers and swap them.
22. Solution:

23. WAP to Input two numbers and swap them without using 3rd variable.
24. Solution:

25. WAP to Input distance (in km) and convert in meter, centimeter, and inches.
26. Solution:

27. WAP to Input minutes and convert in hours and minutes.
28. Solution:

29. WAP to input total number of days and convert it into years, months, weeks, and days.
30. Solution: