Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- main(){
- int num, i=0, pos=0, neg=0, nul=0, par=0, imp=0;
- while (i<=9){
- printf("\n\nEntre com um numero: ");
- scanf("%d", &num);
- if (num %2 == 0){
- par++;
- if (num>0){
- pos++;
- }else if (num==0){
- nul++;
- }else neg++;
- }else if (num %2 == 1){
- imp++;
- if (num>0){
- pos++;
- }else if (num==0){
- nul++;
- }else neg++;
- }
- i++;
- }
- printf("\n\nContagem de numeros:\n\n");
- printf("Numeros Positivos inseridos = %d\nNumeros Negativos inseridos = %d\nNumeros nulos inseridos = %d", pos, neg, nul);
- printf("\nNumeros Pares inseridos = %d\nNumeros Impares inseridos = %d", par, imp);
- getchar();
- getchar();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement