Image

Programs - C Language - Function

Program:

#include<stdio.h>
#include<conio.h>
int largest(int,int,int);
void main(){
int big,a,b,c;
 clrscr();

printf("Enter 3 values: ");
scanf("%d%d%d",&a,&b,&c);
printf("%d is biggest",largest(a,b,c));

 getch();
}
int largest(int a,int b,int c){
int big;
if(a>b){
  if(a>c)
   big=a;
  else
   big=c;
 } else {
 if(b>c)
  big=b;
 else
  big=c;
 }

 return big;
}