Found and fix errors in the following code:
if(number%2=0)
cout<<"Even.";
else
cout<<"Odd.";
if(number%2=0)
cout<<"Even.";
else
cout<<"Odd.";
The first string contains an error: the assignment operator is used (=). But we have to use the equality operator (==).
Fixed code is:
if(number%2==0)
cout<<"Even.";
else
cout<<"Odd.";
Comments
Leave a comment