prev


Ternary Operator

30. Biggest of three numbers(Nested Ternary Operator(10.7.2009)

/*
Program# 30
date : 25-12-2008
Biggest of three numbers
*/

#include <stdio.h>
main(){
int a,b,c,d;
printf("\nEnter three integers :");
scanf("%d %d %d",&a,&b,&c);
d=(a>b)?((a>c)?a:c):((b>c)?b:c);
printf("\n%d : Biggest number\n",d);
}

output:
Enter three integers :12 34 3
34 : Biggest number

next
blog comments powered by Disqus