Write a program for a one dimensional integer array A with maximal number of elements =1000 (const=1000) that:
a) Input by the keyboard the number N of the concrete array;
b) Input the elements of the array from the keyboard (i) or from the text file F1 (ii) or randomly generate the array (iii);
c) Finds: (c1) the values of the first minimal (min) and the first maximal (max) element of the array A and their indices imin and imax; (c2) the indices of all minimal and all maximal elements that should be write to the array INDMIN and INDMAX, respectively; (c3) Sort the elements of the array A in decreasing order of the their values. Use any sorting algorithm (straight selection, quicksort, etc.);
d) Output the results from (c) to the screen of the computer monitor and to a text file F2.
Whether it is or is not the case, it certainly looks like you're trying to pawn off an assignment to the members of this forum. Give it a solid effort and ask for specific help on anything you're stuck.
@ jeff: I'm pretty sure that IS the case -> http://cplusplus.com/forum/beginner/42355/
Drue helped him learn nothing there which will only hurt him in the long run when he tries to move on to more advanced concepts without a solid grasp of the basics.
@ Mathhead: Thanks for that "Perl" of wisdom! BTW, I could do it quicker in Python. 8^p