fork download
  1.  
  2. #include <stdio.h>
  3. int main()
  4. {
  5. // Use float or double to keep decimal precision
  6. double a;
  7. a = 2 * 3.141 * 4;
  8.  
  9. // Use %f (or %.3f to limit decimal places) to print floating-point numbers
  10. printf("Result: %.3f\n", a);
  11.  
  12. return 0; // success
  13. }
Success #stdin #stdout 0s 5316KB
stdin
Standard input is empty
stdout
Result: 25.128