mouhamed_ali_groucha _berriri.docx - Compte rendu Mouhamed ali Groucha berriri LSI2 grp 2 Exercice 1 tableau#include<stdio.h> main{int i int

# mouhamed_ali_groucha _berriri.docx - Compte rendu Mouhamed...

This preview shows page 1 - 5 out of 5 pages.

Compte rendu Mouhamed ali Groucha berriri LSI2 grp 2 Exercice 1 tableau : #include<stdio.h> main() {int i; int t1[]={3,5,1,9,7,10,20,100}; int t2[]={7,5,8,9,4,1,4,8}; for (i=0;i<8;i++) { if (t[i]==t1[i]) printf("le position de repitition =%d \n",i); }} Exercice 2 tableau : #include<stdio.h> main() { int l,c,s,i,j; // remplissage taille tableau printf ("donner le ligne et le colonne ") ; do { scanf("%d%d",&l,&c); } while ((l>50)&&(c>50)); int t[l][c]; for(i=0;i<l;i++) {for(k=0;k<c;k++) {printf("donner t[%d][%d] =",i,k); scanf("%d",&t[i][k]); } }
//affichage de la matrice for(i=0;i<l;i++) { printf("\n"); for(k=0;k<c;k++) { printf("%2d",t[i][k]); } } // la somme de chaque ligne : for(i=0;i<l;i++) {s=0; for(k=0;k<c;k++) s=s+t[i][k]; printf("\n la somme de ligne %d= %d",i,s); } //somme de chaque colonne for(k=0;k<c;k++) {s=0; for(i=0;i<l;i++) s=s+t[i][k]; printf("\n la somme de colonne %d= %d",k,s); } } Exercice 1 structure : #include<stdio.h> #include<string.h> struct avion { int numav ; char type[20]; int capacite; int dat_cir;
}; main() { //lire 3 avion : avion t[3]; int i; for(i=0;i<3;i++) { printf("donner l'avion %d\n",i); scanf("%d%s%d%d",&t[i].numav,&t[i].type,&t[i].capacite,&t[i].dat_cir);

#### You've reached the end of your free preview.

Want to read all 5 pages?

• Summer '20
• nombre complexe, Aéroport international de Fortaleza, Groucha berriri

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern