Drowze

03 Comando Condicional de Selecao 05

Mar 29th, 2014
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.33 KB | None | 0 0
  1. /* Fazer um programa que receba um número e diga se ele é par ou ímpar. */
  2. #include <stdio.h>
  3. #include <stdlib.h>
  4. #include <math.h>
  5.  
  6. void main()
  7. {
  8.     int a;
  9.  
  10.     printf("Digite um numero e direi se ele eh par ou impar: ");
  11.     scanf("%d", &a);
  12.  
  13.     if(a%2==0) printf("Eh par\n",a);
  14.     else printf("Eh impar\n");
  15.  
  16.     system("pause");
  17. }
Advertisement
Add Comment
Please, Sign In to add comment