← Back to If Statements
Question 340
Membership Price
Membership Price
Read two integers withscanf: aprice, then a membership flag (1for member,0for non-member). Members get10off; non-members pay full price. Print the amount to pay with no trailing newline. For input50 1the output is40; for input50 0the output is50.
Expected Output:
40= newline. No newline after the last line.
Hints3 available
Sign in to use hintsTopics:
If Statements
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.