C Program Find Minimum Value
/* Write a program to find minimum no out of three numbers by using Conditional Operator(nested..if ). */
#include <stdio.h>
int main(void) {
int a,b,c;
printf("Enter Three Values : ");
scanf("%d %d %d",&a,&b,&c);
printf("\n Minimum Value is : %d",((a<b)?(a<c?a:c):(b<c?b:c)));
return 0;
}
#include <stdio.h>
int main(void) {
int a,b,c;
printf("Enter Three Values : ");
scanf("%d %d %d",&a,&b,&c);
printf("\n Minimum Value is : %d",((a<b)?(a<c?a:c):(b<c?b:c)));
return 0;
}
Comments
Post a Comment