Académique Documents
Professionnel Documents
Culture Documents
REPUBLIQUE DU CAMEROUN
PEACE-WORK –FATHERLAND
PAIX - TRAVAIL - PATRIE
MINISTRY OF SECONDARY EDUCATION
MINISTERE DES ENSEIGNEMENT SECONDAIRE
REGIONAL DELEGATION FOR THE CENTER
DELEGATION REGIONALE DU CENTRE
MEFOU ET AKONO DIVIONAL DELEGATION
DELEGATION DEPARTEMENTALE DE LA MEFOU ET AKONO
G.B.H.S OF MBALNGONG
LYCEE BILINGUE DE MBALNGONG
EXAMINATEUR : M. MOYOU
Page 1 sur 2
Problème : Manipulation des tableaux (6pts)
Soit le programme suivant écrit en langage C :
#include <stdio.h>
#define SIZE 6
int main( )
{
int tab[6] ;
int i, j, tmp;
for (i=0 ; i <= SIZE-2; i++)
{
for (j = SIZE-1 ; j >= i+1; j--)
{
if (tab[j] < tab[j-1])
{
tmp = tab[j];
tab[j] = tab[j-1];
tab[j-1] = tmp;
}
}
}
printf("\n******** RESULTAT ********\n");
for (i=0; i < SIZE; i++)
{
printf("%d", tab[i]);
}
Return 1;
}
1. Quel est l’indice de début et de fin d’un tableau de n éléments en langage C (0.5pt)
2. Quel est le rôle de la variable size dans ce programme et quelle est sa valeur ? (0.5pt)
3. Donner le rôle de chacune des instructions suivantes : a) i ++ b) j -- (0.5pt)
4. Exécuter pas à pas ce programme avec le tableau tab {3, -2, 7, -5, 1, 30} (2.5pts)
5. Qu’affiche ce programme ? (1pt)
6. Que fait ce programme ? (1pt)
EXAMINATEUR : M. MOYOU
Page 2 sur 2