Question: Please answer this with basic c language Question 1- A number with a decimal point is the sum of two parts: an integer part before

Please answer this with basic c language

Question 1- 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. Similarly, -3.546 has -3 as the integer part and -.546 as the fractional part.

Write a program that asks you to input a number of type double, and then outputs its integer part. For example if the input is 2.43, the output should be 2. If the input is -3.546, the output should be -3.

Question 2 - Integer to Double: Write a function named f that takes an integer value as its parameter. When you call the function with an integer, it should return a number of type double with the same value as the integer. Use it with a main function that asks the user to input an integer, then calls the function with the value the user input, and outputs the returned value. Please note that this question tests you ability to write a function and you will lose 5 points if you do not use a function. The input format must be for an integer and the output must be in a format appropriate for the type double.

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!