1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83
| #include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[])
{
int tab1[3], tab2[3];
int i=0, choix=0;
//SAISIE DES VALEURS
printf("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
printf("=======SAISIE DES VALEURS DU TABLEAU NUMERO 1========\n");
for(i=0;i<=3;i++)
{
printf("Veuillez rentrer la valeur %d : ",i);
scanf("%d",&tab1[i]);
printf("\n");
}
printf("=======SAISIE DES VALEURS DU TABLEAU NUMERO 2========\n");
for(i=0;i<=3;i++)
{
printf("Veuillez rentrer la valeur %d : ",i);
scanf("%d",&tab2[i]);
printf("\n");
}
//UTILISATION DES FONCTIONS SOUHAITEE
printf("=======VEUILLEZ CHOISIR UNE APPLICATION=========\n");
printf("1-AFFICHER ELEMENTS DES TABLEAUX\n");
printf("2-SOMME ELEMENTS TABLEAU 1\n");
printf("3-MOYENNE ELEMENTS TABLEAU 1\n");
printf("4-COPIER TABLEAU 1 DANS TABLEAU 2\n");
printf("5-MAXIMUM TABLEAU 1\n");
printf("6-ORDONNER TABLEAU 1\n");
printf(" VOTRE CHOIX: ");
scanf("%d",&choix);
switch(choix)
{
case 1:
display(tab1,tab2);
break;
case 2:
printf("Simple test fonction 1\n");
display(tab1,tab2);
break;
case 3:
printf("En cours\n");
break;
case 4:
printf("En cours\n");
break;
case 5:
printf("En cours\n");
break;
case 6:
printf("En cours\n");
break;
default:
printf("Nous n'avons pas compris votre demande");
break;
}
return 0;
}
int display(int tab1[],int tab2[])
{
int i=0;
for(i=0;i<=3;i++)
{
printf("\n\nTABLEAU 1: Votre valeur numero %d est: %d",i,tab1[i]);
}
for(i=0;i<=3;i++)
{
printf("\n\n TABLEAU 2: Votre valeur numero %d est: %d",i,tab2[i]);
}
return 0;
} |
Partager