C Union Enum Bitfields Macros 31May2023

C Union Enum Bitfields Macros 31May2023

University

10 Qs

quiz-placeholder

Similar activities

Programming practices - C programming

Programming practices - C programming

University

9 Qs

Tech Quiz

Tech Quiz

University

10 Qs

ECE-C Quiz _3

ECE-C Quiz _3

University

10 Qs

Pengantar Coding 2

Pengantar Coding 2

University

10 Qs

Quiz on Basics of C

Quiz on Basics of C

University

10 Qs

Day 1 Quiz

Day 1 Quiz

11th Grade - University

12 Qs

Programming 1

Programming 1

University

10 Qs

Printf, scanf

Printf, scanf

University

12 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?