1) What do you think the following program will print if you type from the keyboard the numbers 3 for a and 8 for b ? #include < iostream> using namespace std; int main() { int a, b; cin >> a >> b; if (a > b && b > 7) { if(a < 7) cout << “ a less than 7: “ << a << ‘\n’; else cout << “Else branch executed\n”; return 0; }
Given code is #include <iostream> using namespace std; int main() { int a, b; cin >> a >> b; if (a > b && b > 7) { if(a < 7) cout << " a less than 7: " << a << '\n'; else cout << "Else branch executed\n"; } return 0; } So, when a is 3 and b is 8 a > b && b > 7 = 3 > 8 && 8 > 7 = false && 8 > 7 = false So, code does not prints anything
No output code does not prints anything
Get Answers For Free
Most questions answered within 1 hours.