+ 2
If statement if(???){ Printf("hello");}else{printf("world");} wht is the condition and output is :hello world
guess the condition
6 Réponses
+ 1
I agree based on the condition only if statement can move either true part or else part . Here my branches question is which condition through we print both?? I hope now you can understand .
+ 1
IF <always true cond.>
goto ELSE
ELSE {}
There's no point in having an IF statement if both branches are executed.
+ 1
goto is not condition ..... got it
I need condition .
anyway your answer right only .
+ 1
is that even possible ??
+ 1
yes sure possible one
- 1
You cannot run both branches of the IF statement in your code.
The syntax prevents you from doing so:
IF <condition> /*Here it evaluates which branch to run. If the condition is met, it will run on Branch 1, otherwise on branch 2. It's either this or that.*/
{Execute Branch 1}
ELSE
{Execute Branch 2}