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
Signed by: hwpplayer1
GPG Key ID: 03E547D043AB6C8F
2 changed files with 39 additions and 0 deletions

View File

@ -1,5 +1,26 @@
2024-10-29 Mert Gör <mertgor@masscollabs.xyz>
* c-basic/d-f.c: #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;
}
* c-basic/hello.c (main): Hello World Example which is forgotten at start
* c-basic/hex.c: Experımental Branch page 21

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;
}