0 0 votes applied gate test series What is the output of the following c-code[ Note: Assume integer as 2 bytes] ? #include<stdio.h> int main() { int x = 500; char *p=&x; *++p=2; printf(“%d”,x); return 0; } Programming in C programming test-series numerical-answers + – its_vaibhav 1.3k views answer comment Share Follow Print 0 reply Please log in or register to add a comment.
2 2 votes At the last x = 512 + 244 = 756 here 512 is upper nibble and 244 is lower nibble value Value change when we use a big-endian processor in place of a little-endian. Yaman Sahu answered Jan 12, 2022 Yaman Sahu comment Share Follow See all 5 Comments 5 5 Comments reply its_vaibhav commented Jan 12, 2022 reply Follow flag thanks bro just one doubt now where will p be pointing after this? at address 1000 or 1001 0 0 replyShare Yaman Sahu commented Jan 12, 2022 reply Follow flag 1001 1 1 replyShare anon1 commented Jan 12, 2022 reply Follow flag What upper nibble lower nibble? Nibble means 4 bit 1 1 replyShare Yaman Sahu commented Jan 12, 2022 reply Follow flag @raja11sep lower nibble means the lower address 1 1 replyShare anon1 commented Jan 12, 2022 reply Follow flag ok,,thanks 1 1 replyShare Please log in or register to add a comment.