Explore topic-wise MCQs in Attributes .

This section includes 8 Mcqs, each offering curated multiple-choice questions to sharpen your Attributes knowledge and support exam preparation. Choose a topic below to get started.

1.

Which of the following statements are correct about Structures used in C#.NET?

A. 1, 2, 4
B. 2, 3, 5
C. 2, 4
D. 1, 3
Answer» C. 2, 4
2.

Which of the following will be the correct output for the program given below?

A. 9 9
B. 9 5
C. 5 5
D. 5 9
Answer» C. 5 5
3.

Which of the following are true about classes and struct?

A. 1, 2, 4
B. 3, 5
C. 2, 4
D. 3, 4, 5
Answer» B. 3, 5
4.

Which of the following statements are correct about the structure declaration given below?

A. 1, 2
B. 1, 3, 5
C. 2, 4
D. 3, 4, 5
Answer» C. 2, 4
5.

Which of the following will be the correct result of the statement b = a in the C#.NET code snippet given below?

A. All elements of a will get copied into corresponding elements of b .
B. Address stored in a will get copied into b .
C. Once assignment is over a will get garbage collected.
D. Once assignment is over a will go out of scope, hence will die.
Answer» B. Address stored in a will get copied into b .
6.

How many bytes will the structure variable samp occupy in memory if it is defined as shown below?

A. 20 bytes
B. 12 bytes
C. 8 bytes
D. 16 bytes
Answer» C. 8 bytes
7.

Which of the following is the correct way to define a variable of the type struct Emp declared below?

A. 1, 3
B. 2, 5
C. 4, 5
D. 1, 2, 4
Answer» D. 1, 2, 4
8.

Which of the following is the correct way of setting values into the structure variable e defined below?

A. e.name = "Amol"; e.age = 25; e.sal = 5500;
B. With e { .name = "Amol" ; .age = 25 ; .sal = 5500 ; }
C. With emp e { .name = "Amol" ; .age = 25 ; .sal = 5500 ; }
D. e -> name = "Amol"; e -> age = 25; e -> sal = 5500;
Answer» B. With e { .name = "Amol" ; .age = 25 ; .sal = 5500 ; }