# Answer to Question #13537 in C++ for harini

Question #13537

Create a class RationalNumber for representing such numbers. There are 2 private data members named numerator and denominator of type int.

Expert's answer

class RationalNumber{

public:

int numerator, denominator;

void represent(){

& cout<<numerator<<"/"<<denominator<<"\n";

}

};

public:

int numerator, denominator;

void represent(){

& cout<<numerator<<"/"<<denominator<<"\n";

}

};

## Comments

## Leave a comment