+ 2
difference between if and else
7 odpowiedzi
+ 8
if the condition is true the "if" will execute else the "else" part will execute
+ 1
'if' means conditional check ; 'else' used for bypass purpose in programming ..if the conditional check goes falls it will go to else part.
+ 1
You put condition in "if" and according to situation, if "if" condition satisfied then it'll executed, or if "if" condition not satisfied then else will executed if it is in the code.
0
"There will be only one!" if the condition after if evaluates true, the program execute the if part. if it false, it executes the else part anyway!
That means, the program executes or if, or else.
0
Fill in the blanks to compare the variables and output the corresponding text:
x = 10
y = 20
i
x > y
:
print("if statement")
e
print("else statement")
0
if statement can be followed by optional else statement
0
if we have statement we want to do it only wen the condition inside if(condition) we use if statement without else.
and if we have two statement; one if condition in if() true otherwise the second statement will be execute; in this case we put the second statement after else.
so...
we have two ways to if statement:
1.
if ( condition )
{
statement1;
}
2.
if(condition)
{
statement1;
}
else
{
statement2;
}