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

can any one tell me why is this progrom will not work? and if you give input for

ID: 3533703 • Letter: C

Question

can any one tell me why is this progrom will not work? and if you give input for 3 numbers, for which program will generate the wrong output,please give explaination in 15 words, sorry for the out look of this program. do not care about it.----------------- -------------#include <iostream> using namespace std; int main() { int x1, x2, x3; cin >> x1>> x2>> x3; if ((x1<= x2) && (x1<= x3)) cout <<x1<< endl; if ((x2 <=x1) && (x2 <= x3)) cout << x2<<endl; if ((x3<=x1) && (x3<=x2)) cout <<x3<<endl; return 0; }

Explanation / Answer

here you go:

http://ideone.com/d3M2Jf


your problem was not using if else statements--meaning more than 1 output could be displayed

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Chat Now And Get Quote