Can you please explain me this?

#include
using namespace std;

int main(){
long signed CodingBlocks = 2017;
short unsigned BOSS1 = -2018;
unsigned BOSS2 = -2019;
int BOSS3 = -2020;
long long unsigned BOSS4 = -2021;
short unsigned Nagarro = 2018.9;
long signed HackerBlocks = ‘A’;
cout<<CodingBlocks<<endl;
cout<<BOSS1<<endl<<BOSS2<<endl<<BOSS3<<endl<<BOSS4<<endl;
cout<<Nagarro<<endl;
cout<<HackerBlocks<<endl;

return 0;
}

Hi @itismohiton,
can u pls tell in which cout are u facing problem?

i am not getting the concept of signed and unsigned.

@itismohiton
signed integer can store +ive as well as -ive value.
whereas unsigned integer can store only +ive value.
long signed CodingBlocks = 2017; will print 2017;
short unsigned BOSS1 = -2018; will print 63518 which is 65536-2018( short unsigned int have range(0,65535))
short unsigned Nagarro = 2018.9; will print 2018
long signed HackerBlocks = ‘A’; will print 65 ascii value of A
long long unsigned BOSS4 = -2021; will print max value of long long unsigned - BOSS4.
integers can be short int, int , long long with there range differing from each other
Hope dis helps.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.