pvitkovsky
2/3/2018 - 2:42 AM

c_sign_flip_example

#include <stdio.h>

void printInteger(int intNum);

int main(){
    int nPositive = 1234;
    int nNegative = 0;
    nNegative = ~nPositive+1;
    printInteger(nNegative);
	return 0;
}

//Print any integer
void printInteger(int intNum){
	printf("%d ", intNum);
}

//explanation
/*
//Magellan's problem;
//The earth of 2^31 is round (int 4 bytes)
int main(){
    int ship1 = 1;
    int ship2 = 0;
    while(ship1 > ship2){
        ship1++;
        ship2++;
    }
    printLong(pow(2, 63));
    printInteger(ship1);
    printInteger(ship2);
	return 0;
}
*/