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! :)