What is elif and how it works in c++ | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

What is elif and how it works in c++

How elif statement works

30th Sep 2022, 2:40 PM
Franek
Franek - avatar
3 Answers
+ 1
if statement can be followed by an optional else if...else statement, which is very usefull to test various conditions using single if...else if statement. When using if , else if , else statements there are few points to keep in mind. An if can have zero or one else's and it must come after any else if's. An if can have zero to many else if's and they must come before the else. Once an else if succeeds, none of he remaining else if's or else's will be tested.
2nd Oct 2022, 2:36 PM
Karthi Keyan
Karthi Keyan - avatar
+ 1
Thanks
5th Oct 2022, 6:50 AM
Franek
Franek - avatar
0
Do you mean "#elif"?
30th Sep 2022, 3:14 PM
Mustafa A
Mustafa A - avatar