Workshop quiz

Workshop quiz

University

10 Qs

quiz-placeholder

Similar activities

Unit 10 :Structures

Unit 10 :Structures

University

7 Qs

Structures & Union

Structures & Union

University

6 Qs

PPS

PPS

University

12 Qs

EC8393_FDS_MODEL EXAM_3_PART B

EC8393_FDS_MODEL EXAM_3_PART B

University

15 Qs

DS Quiz1

DS Quiz1

University

10 Qs

Structure in C

Structure in C

University

10 Qs

Quiz 9: Pointer

Quiz 9: Pointer

University

12 Qs

Revision 2 MCA

Revision 2 MCA

University

13 Qs

Workshop quiz

Workshop quiz

Assessment

Quiz

Computers

University

Hard

Created by

Mohammed Nawaz

FREE Resource

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is a structure in C?

A way to create a new data type that can hold multiple variables of different types.

A built-in data type.

  • A function that performs calculations.

A control flow statement.

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which keyword is used to define a structure in C?

  • B) define

  • struct

  • union

  • type

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the maximum number of members a structure can have in C?

  • B) 100

  • No fixed limit

  • 50

  • 10

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the main difference between a structure and a union?

  • Unions cannot contain functions.

Structures can hold only integers.

  • Structures are always larger than unions.

  • A structure allocates memory for all its members, while a union allocates memory for only the largest member.

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How do you define a structure named Person with members name (string) and age (integer)?

  • struct Person { char name[50]; int age; };

  • struct Person { int age; char name; };

  • struct { char name; int age; } Person;

Person { char name[50]; int age; };

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What operator is used to access a member of a structure through a pointer?

  • .

  • *

  • ->

  • ::

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Can a structure contain a union as a member?

  • Yes

  • No

  • Only if the structure is empty.

  • Only if the union has no members.

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?