Question: Write a program with two functions: main (as usual) and a function called decimal that will return the decimal part of any non-negative decimal number

Write a program with two functions: main (as usual) and a function called decimal that will return the decimal part of any non-negative decimal number sent to it as input. For example, a call like: decimal(3.7) should return 0.7 As it should be clear, function decimal will have to return a double, and will have to accept a parameter of type double. Define the function so that its return type and parameter type are consistent with the above description. Your program should prompt the user in main to enter a decimal number, and then call function decimal to separate the decimal portion and return the resulting double, a value that main will display. C++ program

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!