Friday, April 12, 2013

Find the biggest number without if condition

Biggest number among 3 number 



#include<stdio.h>
#include<conio.h>
main()
{
int a,b,c,big;
printf("Enter the 1st number: ");
scanf("%d",&a);
printf("Enter the 2nd Number: ");
scanf("%d",&b);
printf("Enter the 3rd Number: ");
scanf("%d",&c);
big=(a>b&&a>c?a:b>c?b:c);
printf("\nThe biggest number is: %d",big);
return 0;
}

No comments:

Post a Comment