Wednesday 30 November 2011

largest of 3 numbers

//largest of 3 nos'
#include<stdio.h>
#include<conio.h>
int max(int a,int b,int c)
{
 int larg;
 larg=a;
 if(b>larg)
  larg=b;
 if(c>larg)
  larg=c;
  return(larg);
}
int main()
{
 int max(int a,int b,int c);
 int x,y,z;
 printf("enter any 3 nos\n");
 scanf("%d%d%d",&x,&y,&z);
 printf("largest no=%d\n",max(x,y,z));
 getch();
 return 0;
}

No comments:

Post a Comment