Find the Largest Number Among Three Numbers


#include<stdio.h>
void findbig(int num1,int num2,int num3);
void main()
{
    int num1,num2,num3;
    printf("Largest of three numbers:");
    printf("\nEnter the numbers one by one");
    scanf("%d",&num1);
    scanf("%d",&num2);
    scanf("%d",&num3);
    findbig(num1,num2,num3);
}
void findbig(int num1,int num2,int num3)
{
    if(num1>num2&&num1>num3)
        printf("\n%d is the largest among %d, %d and %d",num1,num1,num2,num3);
    else if(num2>num1&&num2>num3)
        printf("\n%d is the largest among %d, %d and %d",num2,num1,num2,num3);
    else
        printf("\n%d is the largest among %d, %d and %d",num3,num1,num2,num3);
}

No comments:

Post a Comment

Thank you for using this blog.