.
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
int main(void) {
|
||||
int n;
|
||||
int i;
|
||||
|
||||
printf("entrez un entier : ");
|
||||
scanf("%d", &n);
|
||||
|
||||
for (i = 1; i <= 10; i++) {
|
||||
printf("%3d x %2d = %4d\n", n, i, n * i);
|
||||
}
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
int main(void) {
|
||||
int dividende;
|
||||
int diviseur;
|
||||
int quotient;
|
||||
int reste;
|
||||
|
||||
printf("Entrez une valeur >= 0 : ");
|
||||
scanf("%d", ÷nde);
|
||||
|
||||
printf("Entrez une valeur > 0 : ");
|
||||
scanf("%d", &diviseur);
|
||||
|
||||
quotient = 0;
|
||||
reste = dividende;
|
||||
|
||||
while (reste >= diviseur) {
|
||||
reste = reste - diviseur;
|
||||
quotient++;
|
||||
}
|
||||
|
||||
printf("--> %d = %d x %d + %d\n", dividende, quotient, diviseur, reste);
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
Executable
BIN
Binary file not shown.
@@ -0,0 +1,19 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
int main(void) {
|
||||
double capital;
|
||||
int annee;
|
||||
|
||||
do {
|
||||
printf("Montant a investir (entre 1000 et 50000) : ");
|
||||
scanf("%lf", &capital);
|
||||
} while (capital < 1000.0 || capital > 50000.0);
|
||||
|
||||
for (annee = 1; annee <= 7; annee++) {
|
||||
capital = capital * 1.04;
|
||||
printf("Annee %d : %.2f €\n", annee, capital);
|
||||
}
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
Executable
BIN
Binary file not shown.
@@ -0,0 +1,27 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
int main(void) {
|
||||
int a;
|
||||
int b;
|
||||
int min;
|
||||
int max;
|
||||
int i;
|
||||
|
||||
printf("Entrez deux entiers : ");
|
||||
scanf("%d %d", &a, &b);
|
||||
|
||||
if (a < b) {
|
||||
min = a;
|
||||
max = b;
|
||||
} else {
|
||||
min = b;
|
||||
max = a;
|
||||
}
|
||||
|
||||
for (i = min; i <= max; i++) {
|
||||
printf("%d\n", i);
|
||||
}
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
Executable
BIN
Binary file not shown.
@@ -0,0 +1,29 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
int main(void) {
|
||||
int a;
|
||||
int b;
|
||||
int min;
|
||||
int max;
|
||||
int i;
|
||||
|
||||
printf("Entrez deux entiers : ");
|
||||
scanf("%d %d", &a, &b);
|
||||
|
||||
if (a < b) {
|
||||
min = a;
|
||||
max = b;
|
||||
} else {
|
||||
min = b;
|
||||
max = a;
|
||||
}
|
||||
|
||||
i = min;
|
||||
while (i <= max) {
|
||||
printf("%d\n", i);
|
||||
i++;
|
||||
}
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
Executable
BIN
Binary file not shown.
@@ -0,0 +1,29 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
int main(void) {
|
||||
int a;
|
||||
int b;
|
||||
int min;
|
||||
int max;
|
||||
int i;
|
||||
|
||||
printf("Entrez deux entiers : ");
|
||||
scanf("%d %d", &a, &b);
|
||||
|
||||
if (a < b) {
|
||||
min = a;
|
||||
max = b;
|
||||
} else {
|
||||
min = b;
|
||||
max = a;
|
||||
}
|
||||
|
||||
i = min;
|
||||
do {
|
||||
printf("%d\n", i);
|
||||
i++;
|
||||
} while (i <= max);
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
Executable
BIN
Binary file not shown.
Reference in New Issue
Block a user