Close
Close

I am reallyyyyy confused about else if statement and nested if else statements????Actually how many statments i mean if and else are there ?? it scrat

   jenny_uppal_1722


Answers

  •   

    You can have any number of statements under if, else if or else. Just treat the if inside another if (in nesting) as other statements of if. Once the compiler will enter into any if then the statements indise it will be executed and if it contains any other if inside itself then the condition of that if is checked and then executed if found true.

    Please ask if you want any further clarifications.


    • can u check (DECIDE IF/ELSE) chapter example and syntax programs of C course..plzz bcz i think there is some error that made me confuse..plzz check once all the programs inside (decide if else)..
      - jenny_uppal_1722
    • Please mention where are you getting confused because I have checked everything. Please mention where are you getting confused or getting any error in any code.
      - Amit Kumar
    • go>else if statements(label)>see example program and syntax program.(in ex program there is [else if]in last) but (in syntax prog there is only [else] written in last)
      - jenny_uppal_1722
    • else is optional. You may or may not use else according to your need. It is explained in your previous question. It is mentioned in the syntax because you can have else and it is not in program because you don't have the need of it there. See the first example of the chapter, there also only if is used without any else and it is perfectly fine to skip the else if you don't need it. Please see the answer of your previous question.
      - Amit Kumar
    • hmm
      - jenny_uppal_1722

Ask Yours
Post Yours
Write your answer