Union in c 10

Union in c 10

University

7 Qs

quiz-placeholder

Similar activities

Basics Of C Programming

Basics Of C Programming

University

10 Qs

pointers and structures

pointers and structures

University

10 Qs

C Program Array and strings

C Program Array and strings

University

10 Qs

TECHNICAL C POINTER JIT04

TECHNICAL C POINTER JIT04

University

8 Qs

unit3 pointers

unit3 pointers

University

10 Qs

OCS752_CP_MODEL 1_PART B (16.10.2020)

OCS752_CP_MODEL 1_PART B (16.10.2020)

University

10 Qs

ITC303 QUIZ #3

ITC303 QUIZ #3

University

10 Qs

FIND THE KEY

FIND THE KEY

University

10 Qs

Union in c 10

Union in c 10

Assessment

Quiz

Computers

University

Easy

Created by

Abhishek Pandey

Used 4+ times

FREE Resource

7 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following are collection of different data types

string

char

float

union

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt


size of union is size of the longest data member in the union

True

false

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

The size of the following union, where an int occupies 4 bytes of memory is

union demo
{
  float x;
  int y;
  char z[10];
};

10

8

7

4

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Size of a structure is determined by size of the.

First member in the structure

Last member in the structure

Sum of the sizes of all members

sizes of largest members

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Union differs from structure in the following way

Only one member can be used at a time

Union cannot have more members

Union initialized all members as structure

all members are used at a time

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Int main()

{ union var { int a, b; };

union var v;

v.a=10;

v.b=20;

printf("%d\n", v.a);

return 0; }

10

30

20

all

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

int main(){  
struct number  
{
    int no;
    char name[20];
  };
  struct number s;
  s.no = 50;
  printf("%d", s.no);
}

5

3

50

Compile time error