Académique Documents
Professionnel Documents
Culture Documents
1.
Écrire une fonction afficher qui prend en paramètre un tableau et sa taille
puis affiche son contenu (une cellule
Par ligne).
Code :
#include<stdio.h>
#include<stdlib.h>
int i;
for (i=0;i<n;i++)
return 0;}
float maxi (float T[],int n)
{ float max;
int i;
max = T[0];
for (i=1;i<n;i++){
max = T[i];
return max;
int i;
float note[10];
int main(){
for(i=0;i<10;i++){
scanf("%f",¬e[i]);
afficher(note,10);
return 0;
*Enregistrement
mot clé struct
Syntaxe
struct Nom_Structure = {
Type1 champ1;
Type2 champ2;
typeN champN;
Exemple :
Struct personne {
Char nom[30] ;
Int age ;
Char sexe ;
Float taille ;
} ;
Exemple
Struct point {
float x ;
float y ;
}p1,p2 ;
Exercice
On veut écrire un programme pour manipuler les tableaux
1.
Écrire une fonction afficher qui prend en paramètre un tableau de personne
et sa taille puis affiche ligne par ligne les informations d’une personne sur
une ligne nom, Age, sexe, taille (une cellule
Par ligne).