Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- int main()
- {
- int even=0,odd=0,pos=0,neg=0,num,i;
- for(i=1; i<=5; i++)
- {
- scanf("%d",&num);
- if(num%2==0)
- {
- even++;
- }
- if(num%2!=0)
- {
- odd++;
- }
- if(num>0)
- {
- pos++;
- }
- if(num<0)
- {
- neg++;
- }
- num=0;
- }
- printf("%d valor(es) par(es)\n",even);
- printf("%d valor(es) impar(es)\n",odd);
- printf("%d valor(es) positivo(s)\n",pos);
- printf("%d valor(es) negativo(s)\n",neg);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement