Explain output of this program

Please explain me this output how it is coming in the powers of 2

@KetanPandey hey we are storing negative number in unsigned number, because of that the number stored in the variables will be complement so for short whose size is 16, number stored will be 2^16 - num. Similarly for others.
If this resolves your doubt mark it as resolved.

Please explain how did you assume size of short as 16 as it depends on type of processor.Rest is understood

@KetanPandey the sizes used are minimum sizes. And yes they can be different but this is an assumption/most common sizes.
If this resolves your doubt mark it as resolved

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.

Q3. Predict Output 1 "/* The output of the following program is ? */ 1) #include 2) using namespace std; 3) int main(){ 4) signed CodingBlocks = 9; 5) signed Nagarro = A; 6) signed char HackerBlocks = ‘A’; 7) cout<<CodingBlocks<<endl; 8) cout<<HackerBlocks<<endl; 9) return 0; } " A 9 Error in line 4 Error in line 5 9 A

Q4. Predict Output 2 “/* What will be the output of the following program ? */ #include using namespace std; int main(){ signed CodingBlocks = 9; short double Nagarro = 8.8; signed char HackerBlocks = ‘A’; cout<<CodingBlocks<<endl; cout<<Nagarro<<endl; cout<<HackerBlocks<<endl; return 0; }” 9 8.8 A "Run Time Error " Error due to Nagrro Error Due to Coding Blocks

Please explain these two questions