CJCoding With Joseph

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:

0

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

Expected Output:

0
Topics:
Structs
Code Editor
1
Tab to indent ยท Ctrl+Enter to run ยท 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.