Advertisement
EconomicSerg

Float and Double Input/Output

Jan 6th, 2021
306
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.28 KB | None | 0 0
  1. #include <stdio.h>
  2. int main()
  3. {
  4.     float num1;
  5.     double num2;
  6.  
  7.     printf("Enter a number: ");
  8.     scanf("%f", &num1);
  9.     printf("Enter another number: ");
  10.     scanf("%lf", &num2);
  11.  
  12.     printf("num1 = %f\n", num1);
  13.     printf("num2 = %lf", num2);
  14.  
  15.     return 0;
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement