Program to find the smallest number of three number.
// program to find the smallest of three Numbers.
#include<stdio.h>
#include<conio.h>
int main()
{
float a,b,c;
printf("Enter the first number :\n");
scanf("%f",&a);
printf("Enter the second number :\n");
scanf("%f",&b);
printf("Enter the third number :\n");
scanf("%f",&c);
if((a<b)&&(a<c))
{
printf("%f is smallest number compare to other number\n",a);
}
else if((b<a)&&(b<c))
{
printf("%f is smallest number compare to other number\n",b);
}
else if((c<a)&&(c<b))
{
printf("%f is smallest number compare to other number\n",c);
}
else if(a==b&&b==c&&c==a)
{
printf("There will be all are equal!");
}
return 0;
}
Output
Enter the first number :
5.658
Enter the second number :
5.659
Enter the third number :
5.657
5.657000 is smallest number compare to other number
****** Thank you *****
Comments
Post a Comment