Saturday, October 31, 2020

C program to find the greatest number amongst the four given number

#include <stdio.h>

int main()

{

    int a,b,c,d;

    printf("Enter a,b,c,d:");

    scanf("%d %d %d %d",&a,&b,&c,&d);

    if(a>b)

    {

        if(a>c)

        {

            if(a>d)

            {

                printf("a");

            }

            else

            {

                printf("d");

            }

        }

        else if(c>d)

        {

            printf("c");

        }

        else

        {

            printf("d");

        }

    }

    else if(b>c)

    {

        if(b>d)

        {

            printf("b");

        }

        else

        {

            printf("d");

        }

    }

    else if(d>c)

    {

        printf("d");

    }

    else

    {

        printf("c");

    }

}

No comments:

Post a Comment

SAP Tcodes

zme27 - Automatic STO creation mmbe - Stock Overview, Material, Batch me51n - Create Purchase Requisition me21n - Create Purchase Order me59...