Advertisement
Guest User

Ler um valor inteiro e informar se ele é par ou impar

a guest
Aug 20th, 2019
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.22 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int numero;
  4.  
  5. void main() {
  6.  
  7.   printf("Digite o numero: ");
  8.  
  9.   scanf("%i", &numero);
  10.  
  11.   if (numero % 2 == 0){
  12.  
  13.   printf("O numero é par!");
  14.  
  15.   }
  16.   else{
  17.  
  18.   printf(" O numero é impar!");
  19.  
  20.   }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement