CJCoding With Joseph
15free / daySign inCreate account

Read 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
Topics
Pointers
Auto-input
40.00\n
This input is automatically fed to your program's stdin
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.