Find the Largest

 #include <stdio.h>

int main () {

int num1 , num2, num3 , largest;

printf("enter the num1\n");

scanf ("%d", &num1);

printf("enter the num2\n");

scanf("%d", &num2);

printf("enter the num3\n");

scanf("%d", &num3);


if (num1 > num2 && num1 > num3)

    largest = num1;

else if (num2 > num1 && num2 > num3)

    largest = num2;

    else largest = num3;

    printf ( " the largest among the three is %d", largest);

return 0 ;

}

Comments

Popular posts from this blog

Factors : using C

Cross shaped pattern

Factorial ! calculation