DEV/DEV1.1/partie_1/reels.c

38 lines
783 B
C
Raw Normal View History

2024-09-17 13:49:35 +02:00
#include <stdio.h>
#include <stdlib.h>
/*int main(void) {
printf("%.15f\n", 12345.678910111213);
return EXIT_SUCCESS;
}*/
/*int main(void) {
printf("%f\n", 5.0+2.5);
printf("%f\n", 5.0-2.5);
printf("%f\n", 5.0*2.5);
printf("%f\n", 5.0/2.5);
printf("%f\n", 5.0%2.5); #pb ici avec %
return EXIT_SUCCESS;
}*/
/*int main(void) { # ne foncitone pas car on divise par 0
printf("%f\n", +1.0/0.0);
printf("%f\n", -1.0/0.0);
printf("%f\n", -0.0/0.0);
return EXIT_SUCCESS;
}*/
int main(void) {
int n;
char lettre;
double x;
printf("Entrez un réel : ");
n = scanf("%lf", &x);
printf("son carré vaut : %f\n", x*x);
printf("entrer un caractère : ");
lettre = getchar();
lettre = getchar();
printf("j'ai lu : %c\n",lettre);
return EXIT_SUCCESS;
}