Mega Code Archive
Categories
/
C Tutorial
/
Operator
Complement
# include
main() { char c1 = 4,c2 = 6,c3 = 3; c3 = ~c1; printf("\n ones complement of c1 = %c",c3); } Suppose c1 = 4, c2 = 6; The value of ~ c1 is interpreted as follows: ~ 0000 0100 ---------- 1111 1011