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

Database And Expert Systems Applications 31st International Conference Dexa 2020 Bratislava Slovakia September 14 17 2020 Proceedings Part 1 Lncs 12391

Authors: Sven Hartmann ,Josef Kung ,Gabriele Kotsis ,A Min Tjoa ,Ismail Khalil

1st Edition

303059002X, 978-3030590024

More Books

Students also viewed these Databases questions