CJCoding With Joseph
15free / daySign inCreate account

Discount a double Price Through Its Pointer

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 — 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.