0

How to implement a code in which both if and else part get executed.?

13th Oct 2017, 4:59 PM
Quazi zunaid
Quazi zunaid - avatar
3 Réponses
+ 14
u can use only" if statement" if u want to execute both the statements bcz if u will use one "if" statement with 1 "else" ... then only 1 of them will executed also if u use 1 "if" statement with 1 "else if" statement then only 1 of them will be executed or none of them will be executed //u need to use only if statement
13th Oct 2017, 5:09 PM
Gaurav Agrawal
Gaurav Agrawal - avatar
+ 10
see the tag @siddharth
13th Oct 2017, 6:22 PM
Gaurav Agrawal
Gaurav Agrawal - avatar
+ 4
int i = 5; if(i > 3) //stuff else //stuff //only if will execute. if(i > 3) //stuff if(i > 4) //stuff if(i > 2) //stuff if(i > 5) //stuff //First 3 if's will execute
13th Oct 2017, 5:56 PM
Meharban Singh
Meharban Singh - avatar