0
How to implement a code in which both if and else part get executed.?
3 Respostas
+ 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
+ 10
see the tag @siddharth
+ 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