/* Program to illustrate the max( ) function */
#include<iostream.h>
#include<conio.h>
#include<stdlib.h>
// defines the max( ) function
void main()
{
int x = 5;
int y = 6;
int z;
z=max(x,y);
cout<<"\nThe maximum number is "<<z ;
getch() ;
}
----------------------------------------
/* Program to illustrate the min( ) function */
#include<iostream.h>
#include<conio.h>
#include<stdlib.h> // defines the min( ) function
void main ( )
{
int x = 1, y = 7, z ;
z=min(x,y) ;
cout<<"\nThe minimum number is "<<z ;
getch();
}
#include<iostream.h>
#include<conio.h>
#include<stdlib.h>
// defines the max( ) function
void main()
{
int x = 5;
int y = 6;
int z;
z=max(x,y);
cout<<"\nThe maximum number is "<<z ;
getch() ;
}
----------------------------------------
/* Program to illustrate the min( ) function */
#include<iostream.h>
#include<conio.h>
#include<stdlib.h> // defines the min( ) function
void main ( )
{
int x = 1, y = 7, z ;
z=min(x,y) ;
cout<<"\nThe minimum number is "<<z ;
getch();
}
0 comments:
Post a Comment