fin de TP06
This commit is contained in:
BIN
DEV1.1/TP06/Table
Executable file
BIN
DEV1.1/TP06/Table
Executable file
Binary file not shown.
16
DEV1.1/TP06/Table.c
Normal file
16
DEV1.1/TP06/Table.c
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
int main(void) {
|
||||||
|
int val=0,i;
|
||||||
|
while(val!=-1) {
|
||||||
|
printf("Donnez un entier : \n");
|
||||||
|
scanf("%d",&val);
|
||||||
|
if (val==-1)
|
||||||
|
break;
|
||||||
|
for(i=1;i<11;i++){
|
||||||
|
printf("%d x %2d = %d \n",val,i,val*i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return EXIT_SUCCESS;
|
||||||
|
}
|
||||||
BIN
DEV1.1/TP06/borne
Executable file
BIN
DEV1.1/TP06/borne
Executable file
Binary file not shown.
29
DEV1.1/TP06/borne.c
Normal file
29
DEV1.1/TP06/borne.c
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
int main(void) {
|
||||||
|
int val1,val2,petit=10000,grand=-10000;
|
||||||
|
while(val1!=-1 || val2!=-1) {
|
||||||
|
printf("Donnez un entier : \n");
|
||||||
|
scanf("%d",&val1);
|
||||||
|
if (val1==-1)
|
||||||
|
break;
|
||||||
|
printf("Donnez un deuxieme entier : \n");
|
||||||
|
scanf("%d",&val2);
|
||||||
|
if (val2==-1)
|
||||||
|
break;
|
||||||
|
if (val1<val2){
|
||||||
|
if (val1<petit)
|
||||||
|
petit=val1;
|
||||||
|
if (val2>grand)
|
||||||
|
grand=val2;
|
||||||
|
}else{
|
||||||
|
if (val2<petit)
|
||||||
|
petit=val2;
|
||||||
|
if (val1>grand)
|
||||||
|
grand=val1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
printf("Le nombre le plus petit est %d et le plus grand est %d \n",petit,grand);
|
||||||
|
return EXIT_SUCCESS;
|
||||||
|
}
|
||||||
BIN
DEV1.1/TP06/division
Executable file
BIN
DEV1.1/TP06/division
Executable file
Binary file not shown.
21
DEV1.1/TP06/division.c
Normal file
21
DEV1.1/TP06/division.c
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
int main(void) {
|
||||||
|
int val1,val2,reste,quotient=0,somme=0;
|
||||||
|
do{
|
||||||
|
printf("Donnez un entier : \n");
|
||||||
|
scanf("%d",&val1);
|
||||||
|
} while (val1<0);
|
||||||
|
do{
|
||||||
|
printf("Donnez un deuxieme entier : \n");
|
||||||
|
scanf("%d",&val2);
|
||||||
|
} while (val2<=0);
|
||||||
|
while ((somme+val2)<val1) {
|
||||||
|
somme+=val2;
|
||||||
|
quotient+=1;
|
||||||
|
}
|
||||||
|
reste=val1-somme;
|
||||||
|
printf("--> %d =%d x %d + %d \n",val1,quotient,val2,reste);
|
||||||
|
return EXIT_SUCCESS;
|
||||||
|
}
|
||||||
BIN
DEV1.1/TP06/filtrage
Executable file
BIN
DEV1.1/TP06/filtrage
Executable file
Binary file not shown.
25
DEV1.1/TP06/filtrage.c
Normal file
25
DEV1.1/TP06/filtrage.c
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
int main(void) {
|
||||||
|
double argent;
|
||||||
|
do{
|
||||||
|
printf("quel est le montant que vous souhaitez poser ? \n");
|
||||||
|
scanf("%lf",&argent);
|
||||||
|
} while (argent<1000 || argent>50000);
|
||||||
|
argent=argent*1.04;
|
||||||
|
printf("L'épargne vous a rapportée : %.2f\n",argent);
|
||||||
|
argent=argent*1.04;
|
||||||
|
printf("L'épargne vous a rapportée : %.2f\n",argent);
|
||||||
|
argent=argent*1.04;
|
||||||
|
printf("L'épargne vous a rapportée : %.2f\n",argent);
|
||||||
|
argent=argent*1.04;
|
||||||
|
printf("L'épargne vous a rapportée : %.2f\n",argent);
|
||||||
|
argent=argent*1.04;
|
||||||
|
printf("L'épargne vous a rapportée : %.2f\n",argent);
|
||||||
|
argent=argent*1.04;
|
||||||
|
printf("L'épargne vous a rapportée : %.2f\n",argent);
|
||||||
|
argent=argent*1.04;
|
||||||
|
printf("L'épargne vous a rapportée : %.2f\n",argent);
|
||||||
|
return EXIT_SUCCESS;
|
||||||
|
}
|
||||||
BIN
DEV1.1/TP06/table
Executable file
BIN
DEV1.1/TP06/table
Executable file
Binary file not shown.
12
DEV1.1/TP06/table.c
Normal file
12
DEV1.1/TP06/table.c
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
int main(void) {
|
||||||
|
int val,i;
|
||||||
|
printf("Donnez un entier : \n");
|
||||||
|
scanf("%d",&val);
|
||||||
|
for(i=1;i<11;i++){
|
||||||
|
printf("%d x %2d = %d \n",val,i,val*i);
|
||||||
|
}
|
||||||
|
return EXIT_SUCCESS;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user