[solved]-Write Program Uses Function Round Number Specified Number Places Ask User Number Round Num Q38992194
Write a program that uses a function to round a number to aspecified number of places. Ask the user for the number to round,and the number of places to round to, and pass those 2 pieces ofdata to the function. Have the function return the rounded numberand then display the original number and the rounded number, withno formatting applied in the printf() statement (so that the full 6digits after the decimal place displays). The statement: y =floor(x * 10 + 0.5) / 10; will round a number to the the tenthsposition. And the statement: y = floor(x * 100 + 0.5) / 100; willround a number to the the hundredths position. Example Run #1:(bold type is what is entered by the user) Enter a number to round:3.14159 Enter the number of decimal places to round to: 3 3.141590rounded to 3 places is x.xxx000. Example Run #2: Enter a number toround: 12.34567 Enter the number of decimal places to round to: 212.345670 rounded to 2 places is xx.xx0000 in c programmingplease
Expert Answer
Answer to Write a program that uses a function to round a number to a specified number of places. Ask the user for the number to r… . . .
OR

