Exercise: Arithmetic Operators

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

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

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

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

  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: C Python

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

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

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

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

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

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

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

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

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

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