Minimum Between three numbers by R4R Team


program-

#include < stdio.h>
int main()
{
int a,b,c;
printf("Enter First number\n");
scanf("%d",&a);
printf("Enter Second number\n");
scanf("%d",&b);
printf("Enter Third number\n");
scanf("%d",&c);
if(a< b && a< c)
{
printf("%d is minimum",a);
}
else
{
if(b< c)
printf("%d is minimum",b);
else
printf("%d is minimum",c);
}
}


output-

Enter First Number
-90
Enter Second Number
1
Enter Third Number
12
-90 is minimum

Enter First Number
45
Enter Second Number
12
Enter Third Number
90
12 is minimum

-In this program, we take a input of the three number and we try to find the minimum number among these three number.
-if(a< b && < c) will execute if first number is smallest than other two.
-if(b< c) will execute if second number is small from third number.
-if above both condition will false then it execute else part and its implied as three number is minimum.




Leave a Comment:
Search
Categories
R4R Team
R4Rin Top Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on R4R.in website is done by expert team not only with the help of books but along with the strong professional knowledge in all context like coding,designing, marketing,etc!