printf double and float with %f and scanf for float %f double %lf

This commit is contained in:
Mert Gör
2024-10-29 21:48:55 +03:00
parent 6ee66a201b
commit dc4079822e
2 changed files with 39 additions and 0 deletions

18
c-basic/d-f.c Normal file
View File

@ -0,0 +1,18 @@
#include <stdio.h>
int main()
{
float f;
double d;
printf("enter a float number: \n");
scanf("%f", &f);
printf("enter a double number: \n");
scanf("%lf", &d);
printf("f = %f, d = %f \n", f , d);
return 0;
}