Biggest Of Three Numbers Using Conditional operator/Ternary Operator in C

int main()
{
       int a,b,c,max;
       printf("Enter three numbers\n");
       scanf("%d%d%d",&a,&b,&c);
       max = a>b?(a>c?a:c):(b>c?b:c);
       printf("%d",max);
       return 0;
}

Comments

Popular posts from this blog

finding how many times a sorted array is rotated