Monday, 24 May 2021

Write a C program that accepts three integers and find the maximum of three.

 Write a C program that accepts three integers and find the maximum of three.




#include 
#include 

int main()
{
    int a, b, c;

    printf("\nEnter the three integer: ");
    scanf("%d %d %d", &a, &b, &c);

    
    if (a > b && a > b)
    {
        printf("Maximum = %d", a);
    }
    else if (b > a && b > c)
    {
        printf("Maximum = %d", b);
    }
    else
    {
        printf("Maximum = %d", c);
    }

    return 0;
}


Output:



Share:

Related Posts:

0 comments:

Post a Comment