Can anyone make me a program which tells the first maximum and second maximum value in an array? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Can anyone make me a program which tells the first maximum and second maximum value in an array?

10th Apr 2018, 2:54 PM
alikhan124
alikhan124 - avatar
2 Answers
+ 1
I'm sure someone can do it. Tell me what you tried and I tell you how it can be done.
10th Apr 2018, 2:58 PM
Alex
Alex - avatar
0
T max1{}, max2{}; for (const auto& x: arr) { ... }
10th Apr 2018, 3:43 PM
Timon Paßlick