
Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
A solution to read 20 unique numbers between 10 and 100 using a single-subscripted array. The problem statement includes instructions to handle the worst case scenario where all 20 numbers are different. The smallest possible array is used to solve this problem.
Typology: Lecture notes
1 / 1
This page cannot be seen from the preview
Don't miss anything!

Question 1
Use a single-subscripted array to solve the following problem. Read in 20 numbers, each of which is between 10 to 100, inclusive. As each number is read, print it only if it is not a duplicate of a number already read. Provide for the “worst case” in which all 20 numbers are different. Use the smallest possible array to solve this problem.