title: How do you get the largest integer from a set of numbers in c++?
body: <p>If you have a group of numbers, like a=4,b=5,c=8. Is there a way to get the program print out the largest value. So, for instance, I have all my values outputted 4,5,8. How can I get the program to output the largest value? (I'm using c++). I used if statements but I feel like there is a shorter way. On Google, I keep finding INT_MAX but doesn't that display the largest number in the int type? </p>
  
  <p>here's part of the code </p>
  
  <pre><code>int a = (rand()%6)+1;
  int b = (rand()%6)+1;
  int c = (rand()%6)+1;
  cout &lt;&lt; int a &lt;&lt; int b &lt;&lt; int c &lt;&lt; endl; //I'm trying to get it to display the largest int out of this group
  </code></pre>
  
  <p>I deleated my if statements trying to find a better way to display the largest of the group. </p>