0
what did i do wrong with if else
#include <iostream> using namespace std; int main() { int a = 54; int b = 55; if(a > b); { cout <<"congrats"; } else { cout <<"dead"; } return 0; } what did i do wrong?
3 Answers
+ 4
after the if condition you have to erase the ";"
0
if(a > b);
no ; needed here
0
The comma used after the if logical expression means the if should do nothing