Advertisement
AntonioVillanueva

Pair & impair

Nov 29th, 2016
205
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.43 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int main() {
  5.     int debut,fin,par;
  6.  
  7.     printf ("debut = ");scanf ("%d",&debut);
  8.     printf ("fin   = ");scanf ("%d",&fin);
  9.  
  10.     do {//Test parite valide ,0 ou 1
  11.         printf ("parite pair(1) ,impair (0)  = ");scanf ("%d",&par);
  12.     }while (par >1);
  13.  
  14.     do{
  15.         (par ^ (debut & 1)) ? printf ("%d\n",debut): printf ("\n");
  16.     }while (debut++<fin);    //Affiche
  17.  
  18. return 0;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement