Magic anti-operation
When I was reading a book today, I saw this amazing thing. I didn't know what the principle is.
The result of a positive number n is-(n + 1)
/*************************************** * *********************************> File Name: test2.c> Author: jukay> Mail: hellojukay@163.com> Created Time: ******************************** **************************************** /# include
Int main () {int I; for (I = 0; I <10111; ++ I) printf ("% d: % d \ n", I ,~ I); return 0 ;}
Result of n-n-1 for an negative h Number
/*************************************** * *********************************> File Name: test2.c> Author: jukay> Mail: hellojukay@163.com> Created Time: ******************************** **************************************** /# include
Int main () {int I; for (I = 0; I <10111; ++ I) printf ("% d: % d \ n", I ,~ I); return 0 ;}