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
| /*Fonction des nombres inférieurs à 15 */
void inferieur (int t[], int n)
{
int j; /*position courante */
for (j=0; t[j]<15; j++);
for (j = 0 ; j < n ; j++)
printf("%d ", t[j]);
printf("\n");
}
/*Fonction des nombres d'indice impair */
void impair (int t[], int n)
{
int j;
if (j%2!=0){
for (j = 0 ; j < n ; j++)
printf("%d ", t[j]);
printf("\n");
}
}
/*Fonction des nombres dans l'ordre inverse de leur saisie */
void inverse (int t[], int n)
{
int j, a; // a permet de stocker une valeur temporairement
for (j=0; j<(n/2); j++);
{
a=t[j];
t[j]=t[n-1-j];
t[n-1-j]=a;
}
for (j = 0 ; j < n ; j++)
printf("%d ", t[j]);
printf("\n");
} |
Partager