How do I? (help please) : while statements with multiple conditions
So here is my question : int a, b, x, y; while (a!=x & b>y){ if (a>=2x){ b=(y-1); cout << "statement0" << endl; cin >> a; if (a==x){ cout << "statement2" << endl; } } else{ if (a==x){ cout << "statement1" << endl; } } /*Q. when the first if statement triggers that sequence, and where a==x gets (statement2), how do I make it so that the (statement1) from the else statement also doesn't show up?*/ example of result: when initial a>=2x: "statement2" "statement1" (//which is not what I want, 2 statements appearing) but when initially a==x: "statement1" (//which is what I want, just a single statement) (this is a not the original code, it does ask for user input, and I use 2x to help visualize that when I set the conditions for twice the value of x or a value greater than x.)