+ 1
Case 1: i=1..so 'if' condition is not satisfied, res=1 (res+i) Case 2: i=2.. 'if' condition satisfied and continue statement is encountered and control goes for the next iteration Case3: i=3 'if' condition not satisfied, res becomes 4 (1+3) Case 4: loop condition is not satisfied So res holds the value 4.
16th Jun 2017, 11:34 PM
Rajat Karnwal
Rajat Karnwal - avatar