← Back to Structs
Question 402
Toggle a Flag Field
Toggle a Flag Field
Astruct Switchhas anintfieldonthat 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
Sign in to use hintsTopics:
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.