/*… Hey guy’s this is a simple program with a twist i have made it with function… try it…*/
#include <stdio.h>
/* function prototype */
int maximum( int, int, int );
/*…main function starts..*/
void main()
{
int a, b, c;
printf( “Enter three integers: ” );
scanf( “%d%d%d”, &a, &b, &c );
printf( “Maximum is: %d\n”, maximum( a, b, c ) );
getch();
}
{
int a, b, c;
printf( “Enter three integers: ” );
scanf( “%d%d%d”, &a, &b, &c );
printf( “Maximum is: %d\n”, maximum( a, b, c ) );
getch();
}
/*…Main Function End’s…*/
/* Function maximum definition */
int maximum( int x, int y, int z )
{
int max = x;
if ( y > max )
max = y;
if ( z > max )
max = z;
return max;
}
/* Function maximum definition */
int maximum( int x, int y, int z )
{
int max = x;
if ( y > max )
max = y;
if ( z > max )
max = z;
return max;
}
//The output is:::::::::::::::::::