Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 1

#include<iostream.

h>
#include<conio.h>
#include<process.h>
void main()
{
int a[16],sum=0,output;
cout<<"Enter the 16 bits"<<endl;
for(int i=0;i<16;i++)
{
cin>>a[i];
if(a[i]!=0 && a[i]!=1)
{
cout<<"Wrong input"<<endl;
exit(0);
}
sum+=a[16];
}
if(sum>=7 && sum<=9)
output=1;
else
output=0;
cout<<"Output: - "<<output<<endl;
}

You might also like