Solution
#include<stdio.h>
#include<string.h>
int main()
{
char parity_value[7],parity_check[7];
int message_index,count=0;
int message[100];
int i;
scanf ("%[^\n]s",parity_value);
scanf("%d",&message_index);
for (i=0;i<message_index;i++)
{
scanf("%d",&message[i]);
}
for(i=0;i< message_index;i++)
{
if(message[i]==1)
count++;
}
if(count%2==0)
{
strcpy(parity_check,"even");
}
else
{
strcpy(parity_check,"odd");
}
if(strcmp(parity_check,parity_value)==0)
{
message[message_index]=0;
}
else
{
message[message_index]=1;
}
for(i=0;i<=message_index;i++)
{
printf("%d",message[i]);
}
return 0;
}
Nice blog..! I really loved reading through this article. Thanks for sharing.
ReplyDeletePython Training
Nice Post. I like your blog. Thanks for Sharing.
ReplyDeletePython Training Institute in Noida
thanks, very informative. You can refer more about Python Language for future articles from here.
ReplyDeletethanks in advance !!
Thank you for sharing such a nice blog.
ReplyDeleteAWS Solutions Architect Certification Online Training from Hyderabad
SQL Server DBA Online Training from USA, Uk, Australia, UAE, Canada
Exchange Server Training Classes
Mean Stack Certification Training In India
.Net Online Training Coaching