Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int tc(int n){
- // Two's complement function, returns (NOT n) + 1
- return ~n + 1;
- }
- int main(){
- int i = 5;
- printf("2c(%i) = %i\n", i, tc(i)); // prints "2c(5) = -5"
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement