The below code gives output -1
.
#include <iostream>
using namespace std;
int main()
{
int x=0;
cout<<~x;
return 0;
}
But when I do the following modifications the answer changes to 4294967295
.
just want to know that why in case of int it is not giving -2147483647
which is 111.... 32 times
#include <iostream>
using namespace std;
int main() {
unsigned int x=0;
cout<<~x;
return 0;
}