How to find greatest of 2 numbers using function with arguments?
CODE
How to find greatest of 2
numbers using function with arguments?
//Write a program to
find greatest of 2 numbers using function with arguments…
int
main()
{
int a,b;
printf("\n enter 2 numbers:");
scanf("%d%d",&a,&b);
void gr(int a,int b);
gr(a,b);
}
void
gr(int a,int b)
{
if(a>b)
printf("\n %d is greater",a);
else if(b>a)
printf("\n %d is greater",b);
else
printf("\n Both are same");
}
Output:
enter 2 numbers:45
78
78 is greater
How to find greatest of 2 numbers using function with arguments?
Reviewed by Unknown
on
December 31, 2018
Rating:
No comments:
If you have any doubt or query ,comment below: