Thursday, 14 June 2018

Program to find maximum of two number in C using user define function

# include <stdio.h>
int maxi ( int , int )
void main ()
{
int a,b,c ;
clrscr () ;
printf ("\n Enter value of a:") ;
scanf ("%d", & a) ;
printf ("\n Enter value of b:") ;
scanf ("%d", & b) ;
c= max (a,b) ;
printf ("\n Maximum no is %d", c) ;
getch () ;
}
int maxi (int a , int b)
{
if (a>b)
return a ;
else
return b ;
}



No comments:

Post a Comment

Featured post

Program to find Volume of given box in java

class volume { public static void main (String args []) { int l=5,b=6,h=10; int volume; volume=l*b*h; System.out.println (" vol...