Question: C# C# C# C# Randomly generate an array of 100 integer numbers ranging from 100 to 999. (A) Identify the indexes of 3 largest numbers
C# C# C# C#
Randomly generate an array of 100 integer numbers ranging from 100 to 999.
(A) Identify the indexes of 3 largest numbers in the array using 3 variables. ( Use only comparisons. Cannot use sorting method for this request.)
(B) Identify the original indexes of ascending-sorted numbers in the array. You may use a sorting algorithm and another array for 100 indexes.
Display the original numbers using 10 lines with 10 numbers in each line. Then (A) answer and then (B) answer.
==============Illustration===============
7 original random numbers: {23 14 36 72 15 18 12}
The original indexes: {0 1 2 3 4 5 6}
7 sorted numbers: {12 14 15 18 23 36 72}
The original indexes of sorted numbers: {6 1 4 5 0 2 3}
==============Output Example===============
Original Random numbers:
xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx
xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx (A) The indexes of 3 largest numbers: xx, xx, xx
(B) The indexes of sorted numbers:
xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx
Thank you :)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
