Lowest price ever! Learn Generative AI for 48% less!
Get my discount0
c++ beginner, about Condition IF() ??
i want to compare between 3 integers to print out the largest is: and the smallest is: by using condition if() only, without using else or while loop!
2 Answers
+ 2
Thanks guys for the support, i was missing that, i appreciate both of those answers. 😘
0
Using if() only:
int largest(int a, int b, int c)
{
if (a > b)
if (a > c)
return a;
if (b > c)
return b;
return c;
}