fork download
  1.  
  2. #include<stdio.h>
  3. #include<math.h>
  4. #define pi 3.14
  5.  
  6. int main ()
  7.  
  8. {
  9.  
  10. float a,b;
  11. int option;
  12. printf("select the value of a=");
  13. scanf("%f",&a);
  14. printf("select the value of b=");
  15. scanf("%f",&b);
  16. printf(" 1.Addition\n 2.Subtraction\n 3.Multiplication\n 4.Division\nChoose an option=\n");
  17. scanf("%d",&option);
  18. if (option==1)
  19. {
  20. printf("The addition is %f\n",a+b);
  21. }
  22. else if (option==2)
  23. {
  24.  
  25. printf("The subtraction is %f\n",a-b);
  26. }
  27. else if (option=3)
  28. {
  29.  
  30. printf("The multiplication is %f\n",a*b);
  31. }
  32. else if (option=4)
  33. {
  34.  
  35. printf("The division is %f\n",a/b);
  36. }
  37. else
  38. {
  39. printf("Invalid Option");
  40. }
  41. }
  42.  
Success #stdin #stdout 0s 5276KB
stdin
Standard input is empty
stdout
select the value of a=select the value of b= 1.Addition
 2.Subtraction
 3.Multiplication
 4.Division
Choose an option=
The multiplication is -0.000000