What will be the output of the following pseudo-code for a given array…

PYQ Accenture Hiring Assessment 2023

What will be the output of the following pseudo-code for a given array a[5]=3,4,6,1,2 and pos=2 [note: n= size of the array i.e. 5 and starting array index is 0]

Declare i,j,n,pos

Repeat for j=pos to n-1

Set a[j]=a[j+1] [end of loop]

n=n-1;

Display the new array

End

  1. A.

    3615

  2. B.

    34215

  3. C.

    3412

  4. D.

    324615

Attempted by 225 students.

Sign up free to check your answer

Sign up free

Explore the full course: Cdac C Cat Complete Preparation

Loading lesson…