(C Programming) Display the largest number and also the smallest number among the 3 numbers. Can anyone help? Thanks.
Our instructor wants us to use the if statements of C Programming, how may I able to do this if there are 3 numbers? Some says it is easy but I couldn't find it easy at my current timeline, I have tried 2 numbers only and it worked. Here's the code... #include <stdio.h> int main() { int a, b ; printf ("Enter the 2 numbers:\n"); scanf ("%d %d", &a, &b); if(a>b) { printf ("%d = a is the greatest number\n", a); printf ("%d = b is the least number\n", b); } if(a<b) { printf ("%d = b is the greatest number\n", b); printf ("%d = a is the least number\n", a); } return 0; }