Answers for "find maximum number between 3 numbers in c"

C
0

find maximum number between 3 numbers in c

#include <stdio.h>
void main()
{
    int num1, num2, num3, max;
    printf("Enter three numbers: ");
    scanf("%d%d%d", &num1, &num2, &num3);
    if(num1 > num2)
    {
        if(num1 > num3)
        {
            max = num1;
        }
        else
        {
            max = num3;
        }
    }
    else
    {
        if(num2 > num3)
        {
            max = num2;
        }
        else
        {
            max = num3;
        }
    }
    printf("Maximum among all three numbers = %d", max);
}
Posted by: Guest on February-25-2022

Code answers related to "find maximum number between 3 numbers in c"

Code answers related to "C"

Browse Popular Code Answers by Language