Program for Greater number in three numbers using function




#include<stdio.h>
#include<conio.h>
void main()
{
int a,b,c;
clrscr();
printf("enter the numbers");
scanf("%d  %d %d",&a,&b,&c);
greater(a,b,c);
getch();
}
greater( a,b,c)
int a,b,c;
{
if(a>b)
{
if(a>c)
{
printf("first number is greater") ;
}
else
{
printf("third number is greater");
}
}
else
{
if(b>c)
{
printf("second number is greater");
}
else
{
printf("third number is greater");
}
}
}




Output

enter the numbers6
7
8
third number is greater

Comments

Popular posts from this blog

Program for calculating Simple Interest using the concept of Default Arguments

Data communication Terminology

Program for Checking whether the given number is Palindrome or not