Learning by doing: Reading books and trying to understand the (code) examples
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

17 lines
268 B

  1. #include <stdio.h>
  2. #include <string.h>
  3. int main (void) {
  4. float number;
  5. printf("Give a float number: ");
  6. scanf("%g", &number);
  7. printf("The input is %.1f or %.1e\n", number, number);
  8. printf("The input is %+.3f or %.3e\n", number, number);
  9. return 0;
  10. }