Sunday, September 29, 2013

Largest value among 3 (three) numbers

Find the largest value among three numbers
Find the largest value among three numbers in C


#include<stdio.h>
main()
{
    int a,b,c,big;
    printf("Enthe the 1st number: ");
    scanf("%d",&a);
    printf("Enthe the 2nd number: ");
    scanf("%d",&b);
    printf("Enthe the 3rd number: ");
    scanf("%d",&c);
    big=(a>b&&a>c?a:b>c?b:c);
    {
    printf("The biggest number is: %d",big);
    }
}

No comments:

Post a Comment