fork download
  1. #include <stdio.h>
  2.  
  3. int main() {
  4. float num = 3;
  5.  
  6. printf("Using %f: %f\n", num); // Output: Using %f: 3.141590
  7. printf("Using %.1f: %.1f\n", num); // Output: Using %.1f: 3.1
  8. return 0;
  9. }
Success #stdin #stdout 0s 5288KB
stdin
Standard input is empty
stdout
Using 3.000000: 0.000000
Using 3.0: 0.0