Sef How many times is the loop executed:
for (int i = 1; i < = 5; i =i+ 3/2 ) { }
Answers
Answered by
0
Answer:
3 times.
Explanation:
As i starts from 1 ,the loop is executed for the first time .Then the iteration we get is i = i +3/2 then the next value after the second loop becomes 3 and after the third time it becomes 5 .The loop stops as it becomes i <= 5 .....therefore the loop is executed 3 times.
Similar questions