fork download
  1. #include <stdio.h>
  2.  
  3.  
  4. void main()
  5. {
  6. int x;
  7. float Kinetic_energy;
  8. float mass;
  9. float velocity;
  10. float I;
  11. float P;
  12. float R;
  13. printf("\nany number goto Kinetic energy program");
  14. printf("\nnumber 0 exit program");
  15. printf("Input number : ");
  16. scanf("%d",&x);
  17. if(x!=0)
  18. {
  19. printf("\nwelcome to Kinetic energy program");
  20. printf("\nInput mass : ");
  21. scanf("%f",&mass);
  22. printf("\nInput velocity : ");
  23. scanf("%f",&velocity);
  24.  
  25. Kinetic_energy = 0.5*(mass*velocity*velocity);
  26. printf("\nKinetic energy = %f",Kinetic_energy);
  27. }
  28. else
  29. {
  30. printf("\nwelcome to Sound intensity program");
  31. printf("\nInput P : ");
  32. scanf("%f",&P);
  33. printf("\nInput R : ");
  34. scanf("%f",&R);
  35.  
  36. I = P/4*3.14*(R*R);
  37. printf("\nI = %f",I);
  38.  
  39. }
  40. }
Success #stdin #stdout 0s 5280KB
stdin
Standard input is empty
stdout
any number goto Kinetic energy program
number 0 exit programInput number : 
welcome to Kinetic energy program
Input mass : 
Input velocity : 
Kinetic energy = 0.000000