If the condition mentioned in the if block is False, which statement will be executed first?
Answers
Answered by
4
Question:-
- If the condition mentioned in the if block is False, which statement will be executed first?
Answer:-
- 2nd statement will be executed (here 2nd statement is statement under ''else' block)
Example:-
//This çode is the extract of Java programming
if (3>4)
System.out.println("first Number is greater");
else
System.out.println("Second number is greater");
Now, refer to the above Example..
is 3>4? condition is false
therefore it will execute second Statement and print "Second number is greater"
Note:-
- Ignore the programming language if you do not know about Java programming this example is only to make you understand well.
- The concept of if-else applies in all kinds of programming language.
Similar questions