plz tell how many times will the loop be executed
Attachments:
Answers
Answered by
3
Hey Friend,
x y x<=y SOP (y/x)
5 50 5<=50(T) 50/5 = 10
10 5<=10(T) 10/5 = 2
2 5<=2(F)
Te loop will only execute if x<=y is true! In this code, the condition is true 2 times. Therefore, the loop too will be executed two times.
Hope it helps!
x y x<=y SOP (y/x)
5 50 5<=50(T) 50/5 = 10
10 5<=10(T) 10/5 = 2
2 5<=2(F)
Te loop will only execute if x<=y is true! In this code, the condition is true 2 times. Therefore, the loop too will be executed two times.
Hope it helps!
Similar questions