Search C Program

Largest value among three variables

/* Largest value among three variables */

int main()
    int a,b,c;
    printf("Enter value of a: ");
    printf("Enter value of b: ");
    printf("Enter value of c: ");
    if(a >= b && a >= c)
        printf("%d is largest",a);
    else if(b >= a && b >= c)
        printf("%d is largest",b);
    else if(c >= a && c >= b)
        printf("%d is largest",c);
    return 0;

Related Posts
Largest among 3 variables using nested if

Find largest value among three variable - conditional operator

No comments:

Post a Comment