Write a c program to find the greatest of two numbers
Write a program to find the largest of two numbers in c
#include<stdio.h>
#include<conio.h>
void main()
{
int large(int,int); //function prototype
int a,b;
clrscr();
printf("Enter two numbers:\n");
scanf("%d%d",&a,&b);
printf("The largest number is %d",large(a,b));
getch();
}
int large(int x, int y)
{
if(x>y)
return(x);
else
return(y);
}
Output:
Enter two numbers:
50
51
The largest number is 51
No comments: