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

Explain rules for constructing variable names in c language, Explain Rules ...

Explain Rules for constructing variable names? The Rules for constructing variable names : a) A variable name is any combination of alphabets, 0 to 9 digits and undersc

Define the c preprocessor, Define the C Preprocessor? Preprocessor' is ...

Define the C Preprocessor? Preprocessor' is a translation stage that is applied to your source code before the compiler proper gets its hands on it usually the preprocessor per

How to insert values in array - c++ program, How to insert values in array ...

How to insert values in array - c++ program: Write a program to insert values in array void main() { int a[2][3][2]={                                 {

Find area under curve, write a c program to find the area under the curve4...

write a c program to find the area under the curve4 f=(x) between x=a and x=l integrate y=(x) between the limits of a and b Solution: #include float    start_point,

C language, WHAT IS A C LANGUAGE? C IS A PROGRAMMING?

WHAT IS A C LANGUAGE? C IS A PROGRAMMING?

Socket Programming, Need someone to look over my assignment for correctness...

Need someone to look over my assignment for correctness and make any necessary changes.

Write a c program to input your full forename, Write a C program to input y...

Write a C program to input your full forename and full surname. e.g James McCarren and display in one string your complete initial and surname i.e J McCarren . Your initial should

Private member functions, P r i va t e Member Functions: A private...

P r i va t e Member Functions: A private member functions can be called by the members of the same class.  Consider the following example.   c l a ss sample

Function that has two int parameters number , Write a function that has two...

Write a function that has two int parameters num and n, and returns TRUE when the nth bit in num is 1, otherwise FALSE. This function should use the function in the above problem.

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