1 votes 1 votes Considering size of int as 2 Bytes and size of char as 1 Byte what will be the output int main() { int a=300; char *b=(char *)&a; *==b=2; printf("%d",a); return 0; } saipriyab asked Sep 21, 2017 saipriyab 398 views answer comment Share Follow See all 3 Comments See all 3 3 Comments reply dd commented Sep 21, 2017 reply Follow Share Hi, check this syntax *==b=2; 1 votes 1 votes saipriyab commented Sep 21, 2017 reply Follow Share yup sorry it is *++b=2 I was not able to edit it now when Iam trying to edit it Iam getting error being displayed. 0 votes 0 votes saxena0612 commented Sep 21, 2017 reply Follow Share Comment here the correct syntax. 0 votes 0 votes Please log in or register to add a comment.
0 votes 0 votes I think error will come....you please check the code again sandeepjkh answered Sep 21, 2017 sandeepjkh comment Share Follow See 1 comment See all 1 1 comment reply saipriyab commented Sep 21, 2017 reply Follow Share yup sorry it is *++b=2 I was not able to edit it now when Iam trying to edit it Iam getting error being displayed. 0 votes 0 votes Please log in or register to add a comment.
0 votes 0 votes Ans 258 As a=300 we can write a 00000001 00101100 where b will be point to Higher byte(00000001) so when we do ++b then it will point to LB(00101100) and then *b =2 so then final value of a =258(00000001 00000010) Ankit001 answered Sep 21, 2017 Ankit001 comment Share Follow See all 0 reply Please log in or register to add a comment.