What operation does the following pseudo code performs Declare an array of…

202520242025

What operation does the following pseudo code performs

Declare an array of string type variable called word

Declare a loopcounter

Store a string in the array word

for loopcounter = (length of the word) – 1 to 0

loopcounter = loopcounter – 1

print arrayword[loopcounter]

endfor

Algorithm end

  1. A.

    It accepts a string

  2. B.

    Prints string in the reverse order

  3. C.

    Prints string in the same order

  4. D.

    None of the above

Attempted by 160 students.

Show answer & explanation

Correct answer: B

The following pseudo code prints the entered string in the reverse order. We have used a reverse for loop, for reverse printing the string

Explore the full course: Coding For Placement