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

C++, Write C++ code for calculating the time table

Write C++ code for calculating the time table

Algorithm , write an algorithm to swap values without using third variable

write an algorithm to swap values without using third variable

Explain automatic variables, Automatic Variables Automatic variables ar...

Automatic Variables Automatic variables are variable which are explained within the functions. They lose their value when the function terminates. It can be accessed only in th

Lua and C++ sprite animation, How would I use variables of a C++ object wit...

How would I use variables of a C++ object within a Lua function, and then call the Lua function from C++ code?

Vision based simultaneous mapping and localization, Project Description: ...

Project Description: Design and prepare software that can navigate a mobile robot using SLAM technique using vision sensor (camera). Skills required are C Programming, Engine

Algorithm, What is an algorithm and write an algorithm to calculate the sim...

What is an algorithm and write an algorithm to calculate the simple interest

Difference between mutex and binary semaphore, Semaphore is used to synchro...

Semaphore is used to synchronize processes. whereas mutex is used to give synchronization among threads running in the similar process.

Recursion, Given a string, print all possible palindromic partitions using ...

Given a string, print all possible palindromic partitions using recursion

What are the different types of endless loops, What are the different types...

What are the different types of endless loops? An endless loop can be of two types: i.) A loop that is intentionally designed to go round and round until the condition withi

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