Skip to content
Sign upLog in
← Back to Community

if and else statements in c++

Profile icon

so i have been learning c++ and im trying to recreate the first program i made in python but im confused on how if, elif(if it exists in c++), and else but no operators are working like = or ==

Profile icon
Profile icon

if and else statements in c++ are what they seem like, in your repl it looks like you are using them correctly.

if (a) {code} else if (b) {code} else {code}

elif does not exist in c++ its only a python thing, use else if instead

one thing to note is that c++ does not care about whitespace so format your code however you like

Profile icon

i dont understand any thing bruhhhhhh