Saturday, 23 March 2019

CPP-EX36

Program to accept two distance figures from the user,compare them and display the larger using inline function

#include<iostream.h>
#include<conio.h>
class distance
{
  int   feet ;
  float inche;
  public:
  inline float max(int feet,float inch)
  {   inch=inch/12;
      return ((feet>inch)?feet:inch);
  }
  };
  void main()
  {
    distance d;
    float m1;
    int a,b;
    clrscr();
    cout<<"Enter  the values"<<endl;
    cin>>a>>b;
    m1=d.max(a,b);
    cout<<"The Max Value is"<<m1;
    getch();
    }