Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions