Else-statement | Sololearn: Learn to code for FREE!
Neuer Kurs! Jeder Programmierer sollte generative KI lernen!
Kostenlose Lektion ausprobieren
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; }

15th Jun 2018, 3:33 PM
Aksh97
Aksh97 - avatar
2 Antworten
0
thanks i just forget. if condition is wrong there will be no output and executes else statement
15th Jun 2018, 3:38 PM
Aksh97
Aksh97 - avatar
0
thank you for quick response
15th Jun 2018, 3:39 PM
Aksh97
Aksh97 - avatar