program to convert fraction to decimalint


Program to convert fraction to decimal:

int main()

{

                float num, denom;     // numerator and denominator of fraction

                float value;          // value of fraction as decimal

 

                cout << "Convert a fraction to a decimal\n";

                cout << "Numerator: ";

                cin >> num;

                cout << "Denominator: ";

                cin >> denom;

 

                value = num / denom;  // convert fraction to decimal

 

                cout << '\n' << num << '/' << denom << '=' << value;

 

                return 0;

}

Request for Solution File

Ask an Expert for Answer!!
C/C++ Programming: program to convert fraction to decimalint
Reference No:- TGS0174802

Expected delivery within 24 Hours