C Program to Find the Largest Number Among Three Numbers

C Program to Find the Largest Number Among Three Numbers

#include <stdio.h>
#include <conio.h>

void main(){

    int a, b, c;
    printf("Enter 3 Numbers: \n");
    scanf("%d %d %d", &a, &b, &c);

    if (a > b && a > c) {
        printf("%d is Greater than %d and %d",a,b,c);
    } else if (b > c) {
        printf("%d is Greater than %d and %d",b,a,c);
    }   else if (c > a) {
        printf("%d is Greater than %d and %d",c,a,b);
    } else {
        printf("all are equal!");
    }
    getch();
}


Output :
Output : Greatest Of 3 Numbers

Leave a Reply

Make sure you tick the "Notify Me" box below the comment form to be notified of follow up comments and replies.