#include<iostream.h>
#include<conio.h>
template <class mytype>
mytype maxi(mytype x,mytype y)
{
return(x>y?x:y);
}
void main()
{
int i,j;
long m,n;
clrscr();
cout<<"\nEnter 2 integers:";
cin>>i>>j;
cout<<"\nEnter 2 long integer:";
cin>>m>>n;
cout<<"\nMaximum of two integers:"<<maxi(i,j)<<endl;
cout<<"\nMaximum of two long values :"<<maxi(m,n)<<endl;
cout<<"\nMaximum of char x and a:"<<maxi('X','a')<<endl;
getch();
}
#include<conio.h>
template <class mytype>
mytype maxi(mytype x,mytype y)
{
return(x>y?x:y);
}
void main()
{
int i,j;
long m,n;
clrscr();
cout<<"\nEnter 2 integers:";
cin>>i>>j;
cout<<"\nEnter 2 long integer:";
cin>>m>>n;
cout<<"\nMaximum of two integers:"<<maxi(i,j)<<endl;
cout<<"\nMaximum of two long values :"<<maxi(m,n)<<endl;
cout<<"\nMaximum of char x and a:"<<maxi('X','a')<<endl;
getch();
}
No comments:
Post a Comment