How to solve an error in a code


Assignment-

Solve the below error:

1stdafx.cpp(9): fatal error C1083: Cannot open include file: 'iostream.h': No such file or directory.

One of programs is:

#include
#include
#include
char xor(char a,char b)
{
if((a=='0' && b=='1') || (a=='1' && b=='0'))
return '1';
else
return '0';
}
void main()
{
clrscr();
int n,i=0;
char s[2][50];
cout<<"enter length-";cin>>n;
char *s1,*s2,*s_and,*s_or,*s_xor=new char[n];
cout<<"n Enter first bit string- ";cin>>s1;
cout<<"n Enter second bit string- ";cin>>s2;
while(n>0)
{
s_xor[i]=xor(s1[i],s2[i]);
s_and[i]=(s1[i]&s2[i]);
s_or[i]=s1[i]|s2[i];

n--;
i++;
}
s_and[i]='';
s_or[i]='';
s_xor[i]='';
cout<getch();
}

Solution Preview :

Prepared by a verified Expert
DOT NET Programming: How to solve an error in a code
Reference No:- TGS01937934

Now Priced at $20 (50% Discount)

Recommended (92%)

Rated (4.4/5)