Cant understand this pls help

Can you please explain what is happening in this problem ?

hi @kunal81198 please tell the question in which you are having problem

I am having problem in the 5th question

hi @kunal81198 short cannot be used with floating point numbers, so writing short double is wrong

This is the 5th question your are talking about 4th one

"/* Output ? */
#include<iostream>
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 @kunal81198 it has to do with the way numbers are stored. Do you know about the 2’s complement form? If not you should read about it.
Basically the MSB in the bit representation of signed numbers is reserved for telling whether the number is positive or negative. But this is not the case in unsigned numbers as there can only be positive numbers. So the binary to decimal conversion will differ and give an unexpected output.

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.