CJCoding With Joseph
15free / daySign inCreate account

Toggle a Flag Field

A struct Switch has an int field on that is currently 1. Toggle it so that 1 becomes 0 (and 0 would become 1), then print the result (see Expected Output).

Use the logical NOT operator !. There is no trailing newline.

Expected Output:

0

= newline. No newline after the last line.

Hints2 available
Topics:
Structs
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.