MaXwEllDeN

Untitled

Jun 16th, 2013
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.38 KB | None | 0 0
  1. #include <iostream.h>
  2.  
  3. bool isPair(int numero){
  4.    return numero % 2 == 0;
  5. }
  6.  
  7. int main(int argc, char * argv[])
  8. {
  9.    int aux;
  10.    for (int a = 1; a <= 20; a++){
  11.       printf("\nDigite um numero: ");
  12.       scanf("%d", &aux);
  13.  
  14.       if (isPair(aux))
  15.             printf("O numero %d e par.\n", aux);
  16.       else
  17.             printf("O numero %d e impar.\n", aux);      
  18.    }
  19.  
  20.    return 0;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment