Friday, 22 November 2019

UGC NET PAPER 2 June 2019 Question 22 (Shift-I)

22. Consider the following C-code fragment running on a 32-bit x86 machine:

typedef struct{
union{
Unsigned char a;
unsigned short b;
}
unsigned char c;
}S;
S B[10];

S*p=&B[4];

S*q=&B[5];

p→ U.b=0x1234;
/* structure S takes 32-bits */
If M is the value of q-p and N is the value of ((int) & (p→ c))-((int)p), then (M,N) is
A (1,1)
B (3,2)
C (1,2)
D (4,4)
ANS. C

PreviousNext
UGC NET CS 2018 July - II Question 21UGC NET CS 2018 July - II Question 23

No comments:

Post a Comment

UGC NET Computer Science December 2019 | Question 16

Question 16 In a certain coding language. 'AEIOU' is written as 'TNHDZ'. Using the same coding language. 'BFJPV' wil...

Popular Posts