C Union Enum Bitfields Macros 31May2023

C Union Enum Bitfields Macros 31May2023

University

10 Qs

quiz-placeholder

Similar activities

QUIZ CC 102 (FUNCTIONS)

QUIZ CC 102 (FUNCTIONS)

University

15 Qs

T_4.2 Identifier, Data Types, Operators & Expressions

T_4.2 Identifier, Data Types, Operators & Expressions

12th Grade - University

10 Qs

C Programming quiz 3

C Programming quiz 3

University

10 Qs

Topic 4 Array

Topic 4 Array

University

10 Qs

C Programming Quiz-5

C Programming Quiz-5

University

10 Qs

ITF+ Throughput, Speed, and Storage

ITF+ Throughput, Speed, and Storage

University

11 Qs

Tutorium 2

Tutorium 2

University

10 Qs

Pretest หน่วยที่ 4

Pretest หน่วยที่ 4

KG - University

15 Qs

C Union Enum Bitfields Macros 31May2023

C Union Enum Bitfields Macros 31May2023

Assessment

Quiz

Computers

University

Practice Problem

Hard

Created by

A M Abirami

Used 4+ times

FREE Resource

AI

Enhance your content in a minute

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

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;

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?