Max Number | SoloLearn: Learn to code for FREE!

0

Max Number

I need to find Max no. Index without sorting . And if there are two same Numbers then i need to give smaller one's index I know from sorting

c++

11/13/2016 7:47:33 AM

Ali Tahir

1 Answer

New Answer

0

int max = arr[0]; for(i=1; i<n; ++i) if(arr[i] > max) max = arr[i];