.
This commit is contained in:
Executable
BIN
Binary file not shown.
@@ -0,0 +1,24 @@
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
|
||||
int main(void) {
|
||||
int x=3;
|
||||
|
||||
if (x=2) {
|
||||
printf("x vaut 2\n");
|
||||
} else {
|
||||
printf("x est different de 2\n");
|
||||
}
|
||||
|
||||
printf("%d\n", x);
|
||||
|
||||
if (x=0) {
|
||||
printf("x vaut 0\n");
|
||||
} else {
|
||||
printf("x est different de 0\n");
|
||||
}
|
||||
|
||||
printf("%d\n", x);
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
int main(void) {
|
||||
int annee;
|
||||
|
||||
printf("Veuillez entrer l'année actuelle : \n");
|
||||
z
|
||||
}
|
||||
Executable
BIN
Binary file not shown.
@@ -0,0 +1,22 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
int main(void) {
|
||||
int n, m, o;
|
||||
int temp;
|
||||
|
||||
printf("Veuillez entrer une première valeur entière : ");
|
||||
scanf("%i", &n);
|
||||
printf("Veuillez entrer une deuxième valeur entière : ");
|
||||
scanf("%i", &m);
|
||||
printf("Veuillez entrer une troisième valeur entière : ");
|
||||
scanf("%i", &o);
|
||||
|
||||
if (n > m) { temp = n; n = m; m = temp; }
|
||||
if (n > o) { temp = n; n = o; o = temp; }
|
||||
if (m > o) { temp = m; m = o; o = temp; }
|
||||
|
||||
printf("Les valeurs dans l'ordre croissant sont : %i < %i < %i\n", n, m, o);
|
||||
|
||||
return 0;
|
||||
}
|
||||
Executable
BIN
Binary file not shown.
@@ -0,0 +1,13 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
int main(void) {
|
||||
int n;
|
||||
|
||||
printf("Veuillez entrer un entier naturel : \n");
|
||||
scanf("%i", &n);
|
||||
int reste = n % 3;
|
||||
int plus_proche = (reste == 0) ? n : (reste == 1) ? n - 1 : n + 1;
|
||||
printf("%i\n", plus_proche);
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
Reference in New Issue
Block a user