cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
Beginners
Get highest number of X numbers
Get highest number of X numbers
Nov 17, 2011 at 3:35pm UTC
mekkatorqu
(416)
Hi,
I know how to get higher numbers of 2
1
2
3
4
5
6
7
int
a = 5, b = 3;
if
(a < b) { }
else
{ }
but how can I get highest number of X numbers? let's say I have 5 random numbers, how can I sort them from lowest to highest, AND get third number from lowest ?
Nov 17, 2011 at 3:42pm UTC
shadow123
(127)
is this your class mate?
http://www.cplusplus.com/forum/beginner/55209/
Nov 17, 2011 at 4:15pm UTC
mekkatorqu
(416)
what ? O_o
Nov 17, 2011 at 4:25pm UTC
Moschops
(7244)
Put the five numbers in a vector. Use sort.
http://www.cplusplus.com/reference/algorithm/sort/
Topic archived. No new replies allowed.