2018 Qno2(c)

 Here's the program:



Time Complexity:     0(1)
              

Logic for the above program:


NOTE:

n is not clearly defined in the question But it must be:

0<n<arrSize 

Comments