I wrote a code for to toggle the port that is given below #include<reg51.h> sbit CLOCK = P0^2; void main() { while(1) { CLOCK = CLOCK^1; } } its not toggling in the IDE please guide me Mahesh
Of course the 'if' version and the ternary operator will almost certainly be the same. But that's not what I said - I said that using the complement operator is likely to give "better" code.