does this language have a limit on how many nested if-else-if statements you can have?
i have like 40 different statements that look like
if(){
else if()
else if()
else if()
else if()....}
else
it is like one of those russian dolls, and I'm wondering if my program will crash on me or something.
|
Thread: c programming question
-
10-18-2013, 09:33 AM #1
c programming question
-
10-18-2013, 09:48 AM #2
-
10-18-2013, 09:53 AM #3
No limit. Look at the switch statement though if it works.
http://www.zentut.com/c-tutorial/c-switch-case/libs gonna lib
-
10-18-2013, 10:21 AM #4
-
-
10-18-2013, 11:42 AM #5
-
10-18-2013, 11:52 AM #6
-
10-18-2013, 12:00 PM #7
-
10-18-2013, 12:07 PM #8
-
-
10-18-2013, 12:20 PM #9
-
10-18-2013, 02:06 PM #10
-
10-18-2013, 04:34 PM #11
-
11-29-2020, 09:34 PM #12
There is no limit.
You can put any number of if else, nested if else, ladder if else.
If else is used to select any one of given two condition.
You can check here.
ebhor.com/if-else-statement-in-c-programming
If you have more number of options any want to select any one then use
switch case
You can check here
ebhor.com/switch-statement-in-c-programming
Keep Learning and keep coding
Bookmarks