Question: 10. Your program includes the following declarations: union Code { char c; short n; double f; }; union Code myCode; Assuming that a char requires

10. Your program includes the following declarations:

union Code

{

char c;

short n;

double f;

};

union Code myCode;

Assuming that a char requires 1 byte, a short requires 4 bytes, and a double requires 8 bytes, how much memory will the myCode variable require?

  1. 1
  2. 4
  3. 8
  4. 13

11. Which operator can you use to retrieve the address of a variable?

  1. &
  2. *
  3. ->
  4. !

12. Select equivalent statements to print value of x from below options.

struct def{

int x;

float y;

};

void main(){

struct def myStruct;

struct def *p = &myStruct;

myStruct.x = 25;

myStruct.y = 1.23;

}

  1. printf(%d , myStruct.x);
  2. printf(%d , *(px));
  3. printf(%d , px);
  4. printf(%d , *p);

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!