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 program, program for lexicographically precedes the given input permutati...

program for lexicographically precedes the given input permutation

What is the difference among malloc/free and new/delete?, What is the diffe...

What is the difference among malloc/free and new/delete? A: Malloc/free do not know about destructors and constructors. New & delete create and destroy objects, whereas malloc &

Assignment, Classify computer systems according to capacity. How they are d...

Classify computer systems according to capacity. How they are different from computers according to the classification of technology. Provide comparative study also.

#Padovan string, A Padovan string P(n) for a natural number n is defined as...

A Padovan string P(n) for a natural number n is defined as: P(0) = ‘X’ P(1) = ‘Y’ P(2) = ‘Z’ P(n) = P(n-2) + P(n-3), n>2 where + denotes string concatenation. For a string of the c

Compiler design-limit the methods, Ask question #Minimum 100Problem : Compi...

Ask question #Minimum 100Problem : Compiler Design - Limit the methods Rahul is a newbie to the programming and while learning the programming language he came to know the followi

AlgorithmS, Algorithm to find the value of the powers raised by integer

Algorithm to find the value of the powers raised by integer

C program to check factorial, C Program to check FACTORIAL   main() ...

C Program to check FACTORIAL   main() {             int i,j,m,fact,sum=0;           clrscr();           printf("ENTER THE NO.: ");           scanf("%d",&m);

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