Discount a double Price Through Its Pointer
easyQuestion 429Read one price (a decimal number) from input, point a double pointer named pp at it, print the original price, then apply a 10 percent discount by writing through pp (*pp = *pp * 0.9;). Print both numbers with exactly two decimal places using %.2f.
Input: one decimal number.
For the input 40.00 print exactly the output shown in Expected Output.
Expected output
Original: 40.00 Discounted: 36.00
= newline. The output ends with a newline, so print one after the last line.
Hints3 available
Sign in to use hintsTopics
Pointers
1
Tab to indent (Esc then Tab to move on) · Ctrl+Enter to run · Shift+Alt+F to format · Ctrl+Space to expand shortcuts (p, fori)
Your output
Run your code to see the output here...
Test cases
Run your code to see test case results.