Assume that x is already defined as being of type char Writ
Assume that x is already defined as being of type char . Write a single expression that will return 0 if x is not zero and return 1 if x is zero [Note that this compiler doesn\'t accept binary constants , so use hexidecimal instead. I.e., for 0b00111111 use 0x3F.]
Solution
We can simply write:
(!x)
when x is non zero, then !x will become zero and hence whole expression will become 0
when x is zero, then then !x will become 1 and hence whole expression will become 1
