Let S be the statement for i : = 1 to N do V[i] + 1 Which of the following…

Let S be the statement
for i : = 1 to N do V[i] + 1
Which of the following perform(s) the same change to V as S?

I. i : = 0;
While i < = N do
Begin i : = i + 1 ; V[i] + 1 and

II. i : = 1;
While i < = N do
Begin V[i] : = V[i] + 1 ; i = i + 1 and

III. i : = 0;
While i < N do
Begin V[i + 1] : = V[i + 1] + 1 ; i = i + 1 and

  1. A.

    I

  2. B.

    II

  3. C.

    III

  4. D.

    None of them are correct

Attempted by 55 students.

Sign up free to check your answer

Sign up free

Explore the full course: Gate Guidance By Sanchit Sir

Loading lesson…