can you please explain me 5th question
5 question is not clear
can you paste the question here`
predict 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;
cout<<((1<<16)-2018)<<endl;
return 0;
}
Correct ans
2017 2^16 - 2018 2^32 -2019 -2020 2^64 - 2021 2018 65
Note 1 bit is reserved for sign + or -
Note 2
int
size = 4bytes = 32 (48) bits
range of
signed int => -2^31 to +2^31-1
unsigned int => 0 to 2^32-1
Short
size = 2 bytes = 16 bits (28)
range of
signed short => -2^15 to 2^15-1
unsigned short => 0 to 2^16-1
now you can easily ans the above question
if you have further doubts feel free to ask