C Union Enum Bitfields Macros 31May2023

C Union Enum Bitfields Macros 31May2023

University

10 Qs

quiz-placeholder

Similar activities

Basics of C

Basics of C

University

10 Qs

C Viva

C Viva

University

10 Qs

TECHNICAL C POINTER JIT04

TECHNICAL C POINTER JIT04

University

8 Qs

pointers and structures

pointers and structures

University

10 Qs

C Program Array and strings

C Program Array and strings

University

10 Qs

Plot the Code

Plot the Code

University

10 Qs

Arrays in C (II yr 02.07.2020)

Arrays in C (II yr 02.07.2020)

University

10 Qs

CIS1101-programming practice

CIS1101-programming practice

University

15 Qs

C Union Enum Bitfields Macros 31May2023

C Union Enum Bitfields Macros 31May2023

Assessment

Quiz

Computers

University

Hard

Created by

A M Abirami

Used 4+ times

FREE Resource

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

What is the size of union u? (runs in GDB compiler)

union u{

int x;

float y;

char z[10];

};

10

8

12

18

2.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

#include <stdio.h>

union u {

int x;

float y;

char z[10];

};

int main()

{

u.x = 2;

printf("%d\n",u.x);

return 0;

}

2

compile time error

undefined output

run time error

3.

FILL IN THE BLANK QUESTION

1 min • 1 pt

#include <stdio.h>

union u{

int x;

float y;

char z[10];

};

int main()

{

union u uu;

uu.x = 2;

printf("%d\n",uu.x);

return 0;

}

4.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

#include <stdio.h>

union u{

int x;

float y;

char z[10];

};

int main()

{

union u uu;

uu.x = 65;

printf("%c\n",uu.z[0]);

return 0;

}

65

A

AA

Undefined

5.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

#include <stdio.h>

struct s {

int x:5;

float y:6

};

int main()

{

struct s ss;

return 0;

}

Compile time error

Run time error

No output

6.

FILL IN THE BLANK QUESTION

1 min • 1 pt

struct s{

int x:5;

float y;

};

When sizeof(struct s) is used, ________ bytes is allocated;

7.

FILL IN THE BLANK QUESTION

1 min • 1 pt

struct s{

int x:5;

};

When sizeof(struct s) is used, ________ bytes is allocated;

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?