C Program to find the greatest among three numbers.
Answer:
#include<stdio.h>
int main()
{
int num1,num2,num3;
printf("Enter three numbers");
scanf("%d%d%d",&num1,&num2,&num3);
if(num1>num2&&num1>num3)
printf("%d is greatest",num1);
else if(num2>num1&&num2>num3)
printf("%d is greatest",num2);
else
printf("%d is greatest",num3);
return 0;
}
C Program to find the smallest among three numbers.
Answer:
#include<stdio.h>
int main()
{
int num1,num2,num3;
printf("Enter three numbers");
scanf("%d%d%d",&num1,&num2,&num3);
if(num1<num2&&num1<num3)
printf("%d is smallest",num1);
else if(num2<num1&&num2<num3)
printf("%d is smallest",num2);
else
printf("%d is smallest",num3);
return 0;
}