C++ Assignment-3
C++ Assignment-3
1. C++ program using inline functions for finding minimum and maximum
of two elements.
#include<iostream>
using namespace std;
class number
{
private:
int x,y;
public:
inline int min(int x, int y)
{
cout<<"Enter the value of x: ";
cin>>x;
cout<<"Enter the value of y: ";
cin>>y;
return (x>y)?x;y;
cout << "Minimum of " << x << " and " << y << " is ";
}
inline int max(int x, int y)
{
cout<<"Enter the value of x: ";
cin>>x;
cout<<"Enter the value of y: ";
cin>>y;
return (x<y)?x:y;