Skip to content

Instantly share code, notes, and snippets.

@FelipeGrijo
Created February 24, 2017 20:17
Show Gist options
  • Save FelipeGrijo/5f86b6b337d4886394a99cacf8fa924a to your computer and use it in GitHub Desktop.
Save FelipeGrijo/5f86b6b337d4886394a99cacf8fa924a to your computer and use it in GitHub Desktop.
2) Entrar com um número e imprimir uma das mensagens: par ou ímpar.
//https://gist.github.com/FelipeGrijo
#include <stdio.h>
int main()
{
int Numero;
printf("Exercicio 2\nDigite um numero:");
//fflush(stdin);
scanf("%d",&Numero);
if(Numero % 2 == 0){
printf("%d - Par\n",Numero);
}
else
{
printf("%d - Impar\n",Numero);
}
system("pause");
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment