Cant't uderstand the output

Why is there a 2^x term ? And when we cout Boss4 there is no 2^x term why so?

hi @03singhgurjot,
CodingBlocks is int so int can store 2017

BOSS1 is an unsigned short since unsigned only stores only positive number , so negative numbers are stored as 2^16 - x (where x is negative) (2^16 because short int contain 16 bits)
so -2018 will be stored as 2^16-2018

BOSS2 is an unsigned int and since int has 32bits so the -2020 will be stored as 2^32

BOSS3 is an int so can store -2020

BOSS4 is an unsigned long long int and since long long int has 64 bits so -2021 will be stored as 2^64-2021

Nagarro is an int so 2018.9 will be stored as 2018 (only the integer part)

HackerBlocks is a signed int so ‘A’ will be stored as its ascii value i.e. 65 due to typecasting s