Advertisement
RayanRam

Parite Tab

Dec 11th, 2015
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.48 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. void test(int x)
  4. {
  5.      if(x%2==0)
  6.      {printf("Il est pair \n");}
  7.      else
  8.      {printf("Il est impaire \n");}
  9. }
  10. int main()
  11. {
  12.     int N,i;
  13.     printf("Quelle taille ? : ");
  14.     scanf("%d",&N);
  15.     int tab[N];
  16.     for(i=0;i<N;i++)
  17.     {
  18.                     printf("Donnez la valeur %d :",i+1);
  19.                     scanf("%d",&tab[i]);
  20.                     test(tab[i]);
  21.     }
  22.     getchar();
  23.     system("PAUSE");
  24.     return 0;
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement