36 lines
564 B
C
36 lines
564 B
C
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
|
|
/* Find the MIN MAX value of three values */
|
|
|
|
int main()
|
|
{
|
|
|
|
int a, b, c;
|
|
|
|
int max, min;
|
|
|
|
printf("Enter first nubmer: ");
|
|
scanf("%d", &a);
|
|
printf("Enter second nubmer: ");
|
|
scanf("%d", &b);
|
|
printf("Enter third nubmer: ");
|
|
scanf("%d", &c);
|
|
|
|
if (a < b)
|
|
{
|
|
max = b;
|
|
min = a;
|
|
}
|
|
|
|
if (max < c)
|
|
max = c;
|
|
|
|
if (c < min)
|
|
min = c;
|
|
|
|
printf("MAXIMUM between 3 numbers = %d\n", max);
|
|
printf("MINIMUM between 3 numbers = %d\n", min);
|
|
|
|
return 0;
|
|
} |