Friday, March 7, 2014

WRITE A FUNCTION TO FIND LARGEST OF TWO VALUES AND PRINT THE RESULT IN CALLING FUNCTION

#include<conio.h>
#include<stdio.h>
void main()
{
int large(int,int);
int a,b,r;
clrscr();
printf("enter the numbers\n");
scanf("%d%d",&a,&b);
r=large(a,b);
printf("the largest value is %d",r);
getch();
}

int large(int a,int b)
{
if(a>b)
return a;
else
return b;
}

No comments:

Post a Comment