1182: PArity

Problem Link

<Source Code>

#include<stdio.h>
int main()
{
unsigned long long j,c,bin[10000],co,i,num,sum,t;
scanf(“%llu”,&t);
for(i=0;i<t;i++)
{co=0;j=0;c=0;
scanf(“%llu”,&num);
sum=0;
while(num!=0)
{
bin[j++]=num%2;
num/=2;
}
for(co=0;co<j;co++)
{if(bin[co]==1)
c++;
}printf(“Case %lld: “,i+1);
printf(“%s\n”,c%2?”odd”:”even”);
}
return 0;
}

Advertisements

About waprogramming

I am in CSE,from CUET
This entry was posted in Uncategorized and tagged , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s