Run ❯
Get your
own
website
×
Change Orientation
Change Theme, Dark/Light
Go to Spaces
#include
using namespace std; int main() { int myInt = 4294967292; unsigned int myUInt = 4294967292; short int mySInt = 65532; unsigned short int myUSInt = 65532; long int myLInt = 18446744073709551612; unsigned long int myULInt = 18446744073709551612; cout << " size: " << 8*sizeof(myInt) << " bits value: " << myInt << "\n"; cout << " size: " << 8*sizeof(myUInt) << " bits value: " << myUInt << "\n"; cout << " size: " << 8*sizeof(mySInt) << " bits value: " << mySInt << "\n"; cout << " size: " << 8*sizeof(myUSInt) << " bits value: " << myUSInt << "\n"; cout << " size: " << 8*sizeof(myLInt) << " bits value: " << myLInt << "\n"; cout << " size: " << 8*sizeof(myULInt) << " bits value: " << myULInt << "\n"; return 0; }
size: 32 bits value: -4
size: 32 bits value: 4294967292
size: 16 bits value: -4
size: 16 bits value: 65532
size: 64 bits value: -4
size: 64 bits value: 18446744073709551612