Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream.h>
- bool isPair(int numero){
- return numero % 2 == 0;
- }
- bool isImpar(int numero){
- return numero % 2 != 0;
- }
- int main(int argc, char * argv[])
- {
- int aux;
- for (int a = 1; a <= 20; a++){
- printf("\nDigite um numero: ");
- scanf("%d", &aux);
- if (isPair(aux))
- printf("O numero %d e par.\n", aux);
- else
- printf("O numero %d e impar.\n", aux);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment