fork download
  1. #include <stdio.h>
  2. int main(void) {
  3. int a = 4;
  4. float b = 5.55;
  5. printf("a+b = %8.4f\n" , a+b);
  6. /*
  7. this is for number of decimal places
  8. and total number of spaces in a+b sum
  9. */
  10. b = 5.55;
  11. printf("the product a and b = %f\n" , a*b );
  12. b = b +4;
  13. printf("the new product of a and b = %f\n" , a*b);
  14. b = b*5;
  15. printf("b = %.2f\n" , b);
  16. a =9;
  17. printf("square root of 9 = %.2f" , sqrt(9));
  18.  
  19. return 0;
  20. }
  21.  
Success #stdin #stdout 0s 5244KB
stdin
Standard input is empty
stdout
a+b =   9.5500
the product a and b = 22.200001
the new product of a and b = 38.200001
b = 47.75
square root of 9 = 3.00