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

Saha, find the minimum total number of shelves

find the minimum total number of shelves

Type compatibility, Define  T y pe c o m p a t i b i li t y? ...

Define  T y pe c o m p a t i b i li t y? T o a s s i g n i n t t o s m a l l i n t t h e v a r i a b l e should b e

Define constructors-extract and insert operators, For your class to work pr...

For your class to work properly, you'll need to define appropriate constructors, extract and insert operators, and of course arithmetic operators. (If you wanted to use it as a gen

Develope a program, Develop a program to meet the following requirements: ...

Develop a program to meet the following requirements: 1. Must use at least one function in addition to main (you can use more) 2. Must use selection 3. Must use deference/indire

Create a program for decision structure , Create the following program or p...

Create the following program or propose one of your own. The program must include at least one of each of the following. Decision structure Repetitive structure fu

C++ Data Structure program, Description A long time ago in a galaxy far, f...

Description A long time ago in a galaxy far, far away, the country Mafghanistan had n cities and m old roads, where each road connected a pair of cities. Due to the treacherous mo

Define the category of function - computer programming, Define the Category...

Define the Category of Function? A function, depending on whether arguments or parameters are present or not and whether a value returned or not, may belong to one of the foll

Define an asset base class, a) Define an Asset base class that provides the...

a) Define an Asset base class that provides the following method: class Asset { public:      virtual double getValue()=0; };   This will be the base class for both stock an

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