- i is starting from 1, incrementing by 1 with each iteration of loop.
- j is starting from 0, j adds i to itself in each iteration of loop, i increments after being added to j. Thus, j = $\sum_{n=1}^{i-1}$ n.
- loop will end when i = whichever of x, y is smaller.
- Suppose, after exiting loop, i == x then
j = $\sum_{n=1}^{x-1}$ n = ( n (n+1) ) / 2 = ( (x-1) (x-1+1) ) / 2 = ( x (x-1) ) / 2.
- Suppose, after exiting loop, i == y then
j = $\sum_{n=1}^{y-1}$ n = ( n (n+1) ) / 2 = ( (y-1) (y-1+1) ) / 2 = ( y (y-1) ) / 2.
Option A : True. From 3, 4, 5.
Option B : True. From 3.
Option C : False. From 3.
Option D : False. From 3, 4, 5.
Answer :- A, B