0
Else-statement
Here condition is false, but it outputs “else” statement. Why???? #include <iostream> using namespace std; int main() { int mark = 90; if (mark < 50) { cout << "You failed." << endl; cout << "Sorry" << endl; } else { cout << "Congratulations!" << endl; cout << "You passed." << endl; cout << "You are awesome!" << endl; } return 0; }
2 Respostas
0
thanks
i just forget.
if condition is wrong there will be no output
and executes else statement
0
thank you for quick response