Question: Write a program that prints a selected number from a line 1.First line of input contains the number of lines to follow 2.First number of

Write a program that prints a selected number from a line

1.First line of input contains the number of lines to follow

2.First number of each line, n>=2, contains the number of integers that follow in the line

3.Those n integers (each integer >=0; <=1000) follow till the end of the line, and should be stored (except the last one) in an array using index numbers 1n-1

4.The last integer p (p>=1 & p<=n-1) in the line is the index (starting from 1) of the integer to select from the line and print

Example Input:

2

3 10 1 2

7 3 8 1 5 8 6 4

Correct output:

1

5

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!