Showing posts with label How to find largest number out of three numbers in C language. Show all posts
Showing posts with label How to find largest number out of three numbers in C language. Show all posts

C program and flowchart to find the largest of three numbers

Following is the flowchart to find out the largest of three number

And following is the C code


#include <stdio.h>
void main(void)
{
    int A,B,C;
    printf("Enter 3 integer number \n");
    scanf("%d",&A);
    scanf("%d",&B);
    scanf("%d",&C);
    if(A>B){
        if(A>C){
            printf(" %d is the Greatest Number \n",A);
        }
        else{
            printf("%d is the greatest Number \n",C);
        }
    }
    else{
            if(B>C){
                printf("%d is the greatest Number \n",B );
            }
            else{
                printf("%d is the greatest Number \n", C);
            }
    }
}