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:

4

3 10 1 2

7 3 8 1 5 8 6 4

4 2 5 1 1

5 3 9 1 6 3

Correct output:

1

5

2

1

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

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

to encourage a drive for change by developing new ideas;

Answered: 1 week ago

Question

4 What are the alternatives to the competences approach?

Answered: 1 week ago