Program to convert fraction to decimal, C/C++ Programming

Assignment Help:

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;

}


Related Discussions:- Program to convert fraction to decimal

I need poker room auto seat program, Project Description: I want a scrip...

Project Description: I want a script for an online poker site. It needs to be scanning all the required tables and when the table meets certain criteria it should take a seat at

Big-m method, big-m method operation reseach in progrmme c++..

big-m method operation reseach in progrmme c++..

#compiler design limiting instrutions, Ravi is a newbie to the programming ...

Ravi is a newbie to the programming and while learning the programming language he came to know the following rules: · Each program must start with ''''''''{'''''''' and end wi

Multilevelinheritance inc++, develop a program read the following informati...

develop a program read the following information from the keyboard in which base class consist of employee name code and destingnation the derived class contain the data members th

Error handling and constructor, Provide me the answer, Can a constructor th...

Provide me the answer, Can a constructor throws an exception? How to handle the error when the constructor fails?

Arrays, Write two different arrays. Store the names in it and then compare ...

Write two different arrays. Store the names in it and then compare if both the names entered by the user are the same.

All topics in c, Give practice in writing program''s..

Give practice in writing program''s..

#title.digital clock, Write a program to print a digital clock which displa...

Write a program to print a digital clock which displays the time for 2 hours .

Law of motion, Ask question asdasasas#Minimum 100 words accepted#

Ask question asdasasas#Minimum 100 words accepted#

What do you signify by stack unwinding?, A: this is a procedure during exce...

A: this is a procedure during exception handling while the destructor is called for all local objects in the stack among the place where the exception was thrown & where this is ca

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd