Question: For Basic c language Swapping Fractional Parts: A number with a decimal point is the sum of two parts: an integer part before the decimal

For Basic c language

Swapping Fractional Parts: A number with a decimal point is the sum of two parts: an integer part before the decimal point and a fractional part which is after the decimal point. For example, 2.43 has 2 as the integer part and .43 as the fractional part. Write a program that asks the user to input two numbers of the type double or float, and outputs them with the fractional parts interchanged. For example if the numbers input are 3.45 and 2.97, the output should be 3.97 and 2.45. You can use either float or double as the type.

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!