difference between if and else | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

difference between if and else

30th Oct 2016, 11:47 AM
tech buddy
tech buddy - avatar
7 Answers
+ 8
if the condition is true the "if" will execute else the "else" part will execute
30th Oct 2016, 11:51 AM
மனோஜ்குமார் பழனிச்சாமி
மனோஜ்குமார் பழனிச்சாமி - avatar
+ 1
'if' means conditional check ; 'else' used for bypass purpose in programming ..if the conditional check goes falls it will go to else part.
9th Nov 2016, 4:37 PM
Gopinatha
Gopinatha - avatar
+ 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.
20th Nov 2016, 10:10 AM
Shivam Singhal
Shivam Singhal - avatar
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.
13th Nov 2016, 4:45 PM
Benedek Máté Tóth
Benedek Máté Tóth - avatar
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")
22nd Nov 2016, 4:32 PM
Mohammad Ali Mahar
Mohammad Ali Mahar - avatar
0
if statement can be followed by optional else statement
24th Dec 2016, 3:53 PM
Ervin Lopera
Ervin Lopera - avatar
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; }
26th Feb 2017, 2:03 PM
hazem
hazem - avatar