Warning: implode(): Invalid arguments passed in /www/wwwroot/jobquiz.info/mdiscuss.php on line 336 Are the following two statement same? 1. a <= 20 ? (b = 30): (c = 30); 2. (a <=20) ? b : (c = 30); ?->(Show Answer!)
1. Are the following two statement same? 1. a <= 20 ? (b = 30): (c = 30); 2. (a <=20) ? b : (c = 30);
Ask Your Doubts Here
Comments
By: guest on 01 Jun 2017 06.01 pm
No, the expressions 1 and 2 are not same. 1. a <= 20 ? (b = 30) : (c = 30); This statement can be rewritten as, if(a <= 20) { b = 30; } else { c = 30; } 2. (a <=20) ? b : (c = 30); This statement can be rewritten as, if(a <= 20) { //Nothing here } else { c = 30; }