2.8

mail@pastecode.io avatar
unknown
c_cpp
2 years ago
555 B
2
Indexable
Never
#include <iostream>
using namespace std;
//prototype
////Max
int Max(int,int);
float Max(float,float);
////Min
int Min(int,int);
float Min(float,float);
int main()
{
    cout<<Max(3,5)<<endl;
    cout<<Max(2.3f,4.5f)<<endl;
    cout<<Min(2,4)<<endl;
    cout<<Min(3.45f,43453.23f);
    return 0;
}
int Max(int x,int y)
{
    return (x > y) ? x : y;
}
float Max(float x,float y)
{
    return (x > y) ? x : y;
}
int Min(int x,int y)
{
    return (x < y) ? x : y;
}
float Min(float x,float y)
{
    return (x < y) ? x : y;
}