How to find greatest of 3 numbers without using leader or nested if-else?

CODE




How to find greatest of 3 numbers without using leader or nested if-else?

int main()
{
    int a,b,c,max;
    printf("\n enter the value of a,b,c=");
    scanf("%d%d%d",&a,&b,&c);
    if(a>b)
        max=a;
    else
        max=b;
    if(c>max)
        max=c;
    printf("\n greatest number=%d",max);
}


Output:
enter the value of a,b,c=
3
5
7

 greatest number=7

How to find greatest of 3 numbers without using leader or nested if-else? How to find greatest of 3 numbers without using leader or nested if-else? Reviewed by Unknown on December 15, 2018 Rating: 5

No comments:

If you have any doubt or query ,comment below:

Programming copyright © 2018-19. Powered by Blogger.