InterviewSolution
Saved Bookmarks
| 1. |
Someone please explain the third one..... |
|
Answer» 242628b)INDIAc)3C) explanationSum = sum +1 will EXECUTE only for i =0,4,8While loop will execute from 0 to 9For i = 0, if statement is true hence sum = 0+1 = 1As i = i+2Next i =2 for which2%4 is not equal to 0 hence sum will not executeSum statement will execute when i = 4 and 8Because 4%4 =0 and 8%4=0When 4%4,sum will BECOME sum = 1+1 = 2Now,sum is 1When 8%4 is true thenSum = 2+ 1 = 3 |
|