#include<iostream.h>
#include<conio.h>
void main()
{
char bin[10],c;
clrscr();
cout<<"\n\n\n\nEnter 8 bit binary no.:";
cin>>bin;
cout<<endl;
for(int i=0;i<9;i++)
{
if(bin[i]=='1')
{
c++;
}
}
i++;
if(c%2==0)
{
bin[8]='0';
cout<<"Even";
}
else
{
bin[8]='1';
cout<<"Odd";
}
cout<<bin;
bin[9]='\0';
getch();
}
Did you try using any search-engine (BING, GOOGLE, ALTA VISTA) to help you do your homework?
I had the same problem too.. but i dont find your solution working either
2,123 views
Usually answered in minutes!
give me more info
My sentiments, exactly, ****!
Pay a computer programmer then. We don't do your homework for you here.
×