Question: Numeric Output Use C-Style strings to do the following: Write a function that will take a double as a parameter. The function output the number,

Numeric Output Use C-Style strings to do the following: Write a function that will take a "double" as a parameter. The function output the number, formatting it in the following way: 1. If the number is negative, it will preface the number with a minus '-' sign 2. If the number is a decimal with no digits to the left of the decimal point, it will include a 'O' to the left of the decimal point 3. The number will be shown with 4 digits to the right of the decimal point. Pad with zeros if necessare. For example: 4 -> 4.0000 4. Commas will be place on the left side of the decimal point in their appropriate place. For example: 1,234,567.0000 5. Write a main function that will prompt the user for a number then call the display function
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
