309 views

1 Answer

Best answer
2 votes
2 votes

binary representation of 404 = 00000001 10010100

Hence this is 2 byte representation of 404.

Hence while computing from backwards,

1st 8 byte's value is 148 (22+24+27) in decimal and next 8 byte's value is 1. (here is your decimal representation : 148 1)

Same method for hex value also. from backwards, 1st 8 byte's hex value is 94 (you can directly find (148)10 = (94)16 )

and similarly next 8 byte's hex value is 01. (hex representation starts with 0x : ans = 0x94 0x01)

To know more about it how it will be stored into memory check answer of this Question : https://gateoverflow.in/173156/%23pointers

selected by

Related questions

2 votes
2 votes
1 answer
3
Pawan Kumar 2 asked Nov 24, 2017
957 views
int main() { int a = 300; char *b = (char *)&a; *++b = 2; printf("%d ",a); return 0; }Consider the size of int as two bytes and size of char as one byte.Machine is little...
0 votes
0 votes
2 answers
4
Narayan Kunal asked Sep 4, 2014
763 views
I saw on http://www.cquestions.com/2009/06/memory-representation-of-int-data-type.html but it seems wrong to me. Please clarify.