Menu mobile
Home
Programming
Python Tutorial
Java Tutorial
C Tutorial
C++ Tutorial
Web Technology
HTML
CSS
Java Script
PHP
React JS
Node JS
Assignment
MS Office
HTML
CSS
Bootstrap
Java Script
JQuery
AngularJs
Project
Blog
QUIZ ON : c - STRUCTURE AND UNION
STRUCTURE AND UNION
00:00:00
English
Hindi
Question No# :
01
out of 18
Which of the following is a User-defined data type?
Which of the following is a User-defined data type?
A.
typedef int Boolean;
typedef int Boolean;
B.
typedef enum {Mon, Tue, Wed, Thu, Fri} Workdays;
typedef enum {Mon, Tue, Wed, Thu, Fri} Workdays;
C.
struct {char name[10], int age};
struct {char name[10], int age};
D.
all of the mentioned
all of the mentioned
Question No# :
02
out of 18
What will be the output of the following code?
struct { int si;
double d;
float *cp; } s ;
void main() {
printf(“%d, %d, %d”, sizeof(s.d), sizeof(s.cp), sizeof(s)); }
What will be the output of the following code?
struct { int si;
double d;
float *cp; } s ;
void main() {
printf(“%d, %d, %d”, sizeof(s.d), sizeof(s.cp), sizeof(s)); }
A.
4, 4, 12
4, 4, 12
B.
8, 2, 12
8, 2, 12
C.
10, 4, 16
10, 4, 16
D.
8, 4, 14
8, 4, 14
Question No# :
03
out of 18
What is the key difference between a structure and a union in C?
What is the key difference between a structure and a union in C?
A.
A structure can store multiple data types, a union cannot
A structure can store multiple data types, a union cannot
B.
A union can store multiple data types, a structure cannot
A union can store multiple data types, a structure cannot
C.
In a structure, only one member can be accessed at a time
In a structure, only one member can be accessed at a time
D.
In a union, only one member can be accessed at a time
In a union, only one member can be accessed at a time
Question No# :
04
out of 18
What is the size of a union in C?
What is the size of a union in C?
A.
The size of the largest member
The size of the largest member
B.
The sum of the sizes of all members
The sum of the sizes of all members
C.
Twice the size of the largest member
Twice the size of the largest member
D.
Size of the smallest member
Size of the smallest member
Question No# :
05
out of 18
User-defined data type can be derived by
उपयोगकर्ता द्वारा परिभाषित डेटा प्रकार द्वारा प्राप्त किया जा सकता है
A.
struct
B.
enum
C.
typedef
D.
all of the mentioned
Question No# :
06
out of 18
Which operator connects the structure name to its member name?
कौन सा ऑपरेटर संरचना के नाम को उसके सदस्य के नाम से जोड़ता है?
A.
- (Minus)
- (Minus)
B.
<- (Left Arrow)
<- (Left Arrow)
C.
. (Dot)
. (Dot)
D.
Both <- and .
Both <- and .
Question No# :
07
out of 18
In C, a struct is used to group together:
In C, a struct is used to group together:
A.
Variables of the same type
Variables of the same type
B.
Variables of the different type
Variables of the different type
C.
Functions and variables
Functions and variables
D.
Only functions
Only functions
Question No# :
08
out of 18
Which of the following cannot be a structure member?
निम्नलिखित में से कौन एक संरचना सदस्य नहीं हो सकता है?
A.
Another structure
Another structure
B.
Function
Function
C.
Array
Array
D.
None of the mentioned
None of the mentioned
Question No# :
09
out of 18
Which of the following access a variable in structure b?
Which of the following access a variable in structure b?
A.
b->var;
b->var;
B.
b.var;
b.var;
C.
b-var;
b-var;
D.
b>var;
b>var;
Question No# :
10
out of 18
Difference between structure and union is
Difference between structure and union is
A.
We can define functions within structures but not within a union
We can define functions within structures but not within a union
B.
We can define functions within union but not within a structure
We can define functions within union but not within a structure
C.
The way memory is allocated
The way memory is allocated
D.
There is no difference
There is no difference
Question No# :
11
out of 18
Which of the data types has the size that is variable?
Which of the data types has the size that is variable?
A.
int
int
B.
struct
struct
C.
float
float
D.
double
double
Question No# :
12
out of 18
enum types are processed by _________
enum types are processed by _________
A.
Compiler
Compiler
B.
Preprocessor
Preprocessor
C.
Linker
Linker
D.
Assembler
Assembler
Question No# :
13
out of 18
Which of the following statements about structures in C is correct?
Which of the following statements about structures in C is correct?
A.
Structures cannot contain arrays
Structures cannot contain arrays
B.
Structures cannot contain other structures
Structures cannot contain other structures
C.
Structures can have members of different data types
Structures can have members of different data types
D.
Structures are the same as arrays
Structures are the same as arrays
Question No# :
14
out of 18
What is the similarity between a structure, union and enumeration?
What is the similarity between a structure, union and enumeration?
A.
All of them let you define new values
All of them let you define new values
B.
All of them let you define new data types
All of them let you define new data types
C.
All of them let you define new pointers
All of them let you define new pointers
D.
All of them let you define new structures
All of them let you define new structures
Question No# :
15
out of 18
Which of the following is a properly defined struct?
Which of the following is a properly defined struct?
A.
struct {int a;}
struct {int a;}
B.
struct a_struct {int a;}
struct a_struct {int a;}
C.
struct a_struct int a;
struct a_struct int a;
D.
struct a_struct {int a;};
struct a_struct {int a;};
Question No# :
16
out of 18
Which properly declares a variable of struct Student?
Which properly declares a variable of struct Student?
A.
struct stu;
struct stu;
B.
struct Student stu;
struct Student stu;
C.
stu;
stu;
D.
int stu
int stu
Question No# :
17
out of 18
If a structure contains another structure as a member, it is called:
If a structure contains another structure as a member, it is called:
A.
Nested structure
Nested structure
B.
Recursive structure
Recursive structure
C.
Union structure
Union structure
D.
Inline structure
Inline structure
Question No# :
18
out of 18
Which of the following are themselves a collection of different data types?
निम्नलिखित में से कौन स्वयं विभिन्न डेटा प्रकारों का एक संग्रह है?
A.
string
B.
structures
C.
char
D.
all of the mentioned
Latest Current Affairs 2025
Online Exam Quiz for One day Exam
Online Typing Test
CCC Online Test 2025
Python Programming Tutorials
Best Computer Training Institute in Prayagraj (Allahabad)
Best Java Training Institute in Prayagraj (Allahabad)
Best Python Training Institute in Prayagraj (Allahabad)
O Level Online Test in Hindi
Bank SSC Railway TET UPTET Question Bank
career counselling in allahabad
Sarkari Naukari Notification
Best Website and Software Company in Allahabad
Sarkari Exam Quiz