Just a beginner and need your help sir

Sir, my prof says we need to make a program that will find the largest number among the 5 inputted numbers. I make many if statement and not work. Look for the other threads in this forum but none is answered.
Thanks in advance.

1
2
3
4
  if ((num1>=num2)&&(num1>=num3)&&(num1>=num4)&&(num1>=num5))
//and vice versa to num2, num3, num4, num5
  cout<<"The highest number among the rest is: ";
//and it'll give me the last inputted number not the highest 


1
2
3
4
5
6
//also like this, this also give me the last inputted number
cout<<"Type your 5 numbers:\n";
cin>>num>>num>>num>>num>>num;
if (num>=num)
cout<<"The highest among the rest is: ";
//and the  output is also the last inputted numbers 


Wishing that anyone can see this and help me. Thank you! :)
Okay Sir. I'll check it out if it helps, and reply here again if not. Thanks for your reply :)
If you have already used for loops, then this is the way to go:

http://www.programming4beginners.com/tutorial/chapter08/minimum-value-algorithm
OKay sir I'll check for it.
http://www.cplusplus.com/reference/algorithm/max/?kw=max
this does not work sir. because turbo c7 is what I'm using. and algorithm header file is not included, this is also my problem.
Sir Kevin C, this does work. thank you very much! Thanks also to sMav.
This Problem is now solved.
Topic archived. No new replies allowed.