Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR C

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);
}
 
PREVIOUS NEXT
Tagged: #find #maximum #number #numbers
ADD COMMENT
Topic
Name
2+7 =