fork download
  1. #include <stdio.h>
  2.  
  3. int main ()
  4.  
  5. {
  6.  
  7. /* variable definition: */
  8. double m,x,b,y;
  9. printf("Enter value of m : ");
  10. //taking input of m
  11. scanf("%f",&m);
  12. printf("Enter value of x : ");
  13. //taking input of x
  14. scanf("%f",&x);
  15. printf("Enter value of b : ");
  16. //taking input of b
  17. scanf("%f",&b);
  18. //calculating y
  19. y=m*x+b;
  20. printf("Y is : %.2f\n",y);
  21. if(y>10)
  22. {
  23. printf("Y is greater than 10.\n");
  24. }
  25. return 0;
  26. }
  27.  
  28.  
Success #stdin #stdout 0s 10320KB
stdin
m=0
x=1
b=2
stdout
Enter value of m : Enter value of x : Enter value of b : Y is : 0.00