Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Need to fix program. Should give the AND of the inputted numbers. #include <iost

ID: 3635003 • Letter: N

Question

Need to fix program. Should give the AND of the inputted numbers.

#include <iostream>

void main();

{
int i;
int k;

cout<<"Enter 0 (false) or 1 (true) for the first value: "<<endl;
cin>> i;
cout<<"Enter 0 (false) or 1 (true) for the second value: "<<endl;
cin>> k;
cout<<"AND"<<endl;
cout<<"k | 0 |1"<<endl;
cout<<"--- | --- | ---"<<endl;
cout<<"0 | 0 |0"<<endl;
cout<<"1 | 0 | 1"<<endl;

if (i==1&k==1)
cout<<"Result is TRUE"<<endl;
else
cout<<"Result is FALSE"<<endl;
}

Explanation / Answer

Please Rate:Thanks

#include <iostream.h>

void main()

{
int i;
int k;

cout<<"Enter 0 (false) or 1 (true) for the first value: "<<endl;
cin>> i;
cout<<"Enter 0 (false) or 1 (true) for the second value: "<<endl;
cin>> k;
cout<<"AND"<<endl;
cout<<"k | 0 |1"<<endl;
cout<<"--- | --- | ---"<<endl;
cout<<"0 | 0 |0"<<endl;
cout<<"1 | 0 | 1"<<endl;

if (i==1&&k==1)
cout<<"Result is TRUE"<<endl;
else
cout<<"Result is FALSE"<<endl;
}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote