I couldn't understand the solution. Explain once

“/* Output ? */ #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; }”

Hello @gaganpreetsachdev1 i am not able to understand what you have pasted.
please post it by saving it on ide.codingblocks.com

explain the solution for the question given in the quiz

Hello @gaganpreetsachdev1 the code which you have shared is explaining the datatypes in c/c++.
and all the results are obvious except the unsigned int and in that only the positive numbers are displayed .
that is if any number is negative then it will represented in the form of 2s compliment.
like representing it in the binary form and then taking 1 compliment and then adding 1 to it .
4 (decimal) -> 00000100 (binary)
1’s complement: 11111011
add 1: 11111100
if you have any further doubt you can ask here:
Happy Learning!!

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.