Explore topic-wise MCQs in C Sharp Programming.

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

1.

_______ enables batch processing, which greatly speeds up high-processing applications.

A. Scalability
B. Reliability
C. Elasticity
D. Utility
Answer» B. Reliability
2.

_______ feature allows you to optimize your system and capture all possible transactions.

A. scalability
B. reliability
C. elasticity
D. none of the mentioned
Answer» D. none of the mentioned
3.

_______ is a pay-as-you-go model matches resources to need on an ongoing basis.

A. Utility
B. Elasticity
C. Low barrier to entry
D. All of the mentioned
Answer» B. Elasticity
4.

When you add a software stack, such as an operating system and applications to the service, the model shifts to _____ model.

A. SaaS
B. PaaS
C. IaaS
D. All of the mentioned
Answer» B. PaaS
5.

A service that concentrates on hardware follows the _________ as a Service model.

A. IaaS
B. CaaS
C. PaaS
D. All of the mentioned
Answer» B. CaaS
6.

Applications that work with cloud computing that have low margins and usually low risk are _____________

A. high touch
B. low touch
C. moderate touch
D. all of the mentioned
Answer» C. moderate touch
7.

Attributes can be associated with the entities.

A. True
B. False
Answer» B. False
8.

Attributes on enumeration types are synthesizable.

A. True
B. False
Answer» C.
9.

Which of the following is used to extract information of non-array types?

A. Vector type
B. Scalar type
C. Non vector type
D. Array type
Answer» C. Non vector type
10.

Array attributes are those which ________

A. Returns array type
B. Can be used on arrays
C. Can’t be used on arrays
D. Returns scalar values
Answer» C. Can’t be used on arrays
11.

How to declare a user defined attribute?

A. ATTRIBUTE name’ return_type;
B. ATTRIBUTE name : return_type;
C. ATTRIBUTE’ name : return_type;
D. ATTRIBUTE’ name’ return_type;
Answer» C. ATTRIBUTE’ name : return_type;
12.

Which can’t be a result of a predefined attribute?

A. A value
B. A function
C. An entity
D. A signal
Answer» D. A signal
13.

What is the basic syntax to write an attribute?

A. Object_name’ attribute_name (parameter)
B. Attribute_name’ Object_name (parameter)
C. Object_name : Attribute_name (parameter)
D. Attribute_name : Object_name (parameter)
Answer» B. Attribute_name’ Object_name (parameter)
14.

How many fundamental kinds of predefined attributes are there?

A. 2
B. 3
C. 4
D. 5
Answer» E.
15.

Predefined attributes are defined as a part of _________ standard.

A. 1164
B. 1076
C. 1162
D. 1093
Answer» C. 1162
16.

What is the use of an attribute?

A. To find all characteristics of an entity
B. To find all characteristics of architecture
C. To extract some additional information about some object
D. To extract information about clock signals
Answer» D. To extract information about clock signals
17.

Which of the following is the correct way of applying the custom attribute called Tested which receives two-arguments - name of the tester and the testgrade? Custom attribute cannot be applied to an assembly. [assembly: Tested("Sachin", testgrade.Good)] [Tested("Virat", testgrade.Excellent)] class customer { /* .... */ } Custom attribute cannot be applied to a method. Custom attribute cannot be applied to a class.

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

Which of the following is the correct way to apply an attribute to an Assembly?

A. [ AssemblyDescription("DCube Component Library") ]
B. [ assembly : AssemblyDescription("DCube Component Library") ]
C. [ Assemblylnfo : AssemblyDescription("DCube Component Library") ]
D. < Assembly: AssemblyDescription("DCube Component Library") >
Answer» C. [ Assemblylnfo : AssemblyDescription("DCube Component Library") ]
19.

It possible to create a custom attribute that can be applied only to specific programming element(s) like ____ .

A. Classes
B. Methods
C. Classes and Methods
D. Classes, Methods and Member-Variables
Answer» D. Classes, Methods and Member-Variables
20.

Which of the following forms of applying an attribute is correct?

A. < Serializable() > class sample { /* ... */ }
B. (Serializable()) class sample { /* ... */ }
C. [ Serializable() ] class sample { /* ... */ }
D. Serializablef) class sample { /* ... */ }
Answer» D. Serializablef) class sample { /* ... */ }
21.

Which of the following correctly describes the contents of the filename AssemblyInfo.cs?

A. It contains method-level attributes.
B. It contains class-level attributes.
C. It contains assembly-level attributes.
D. It contains structure-level attributes.
Answer» D. It contains structure-level attributes.
22.

Which of the following statements are correct about Attributes in C#.NET? On compiling a C#.NET program the attibutes applied are recorded in the metadata of the assembly. On compilation all the attribute's tags are deleted from the program. It is not possible to create custom attributes.. The attributes applied can be read from an assembly using Reflection class. An attribute can have parameters.

A. 1 and 2 only
B. 2 and 4 only
C. 1, 4 and 5 only
D. All of the above
Answer» D. All of the above
23.

Once applied which of the following CANNOT inspect the applied attribute?

A. CLR
B. Linker
C. ASP.NET Runtime
D. Visual Studio.NET
Answer» C. ASP.NET Runtime
24.

Attributes can be applied to Method Class Assembly Namespace Enum

A. 1 and 2 only
B. 1, 2 and 3
C. 4 and 5 only
D. All of the above
Answer» C. 4 and 5 only
25.

Which of the following are correct ways to pass a parameter to an attribute? By value By reference By address By position By name

A. 1, 2
B. 1, 2, 3
C. 4, 5
D. All of the above
Answer» D. All of the above
26.

Which of the following statements are correct about inspecting an attribute in C#.NET? An attribute can be inspected at link-time. An attribute can be inspected at compile-time. An attribute can be inspected at run-time. An attribute can be inspected at design-time.

A. 1, 2
B. 3, 4
C. 1, 3, 4
D. All of the above
Answer» B. 3, 4
27.

Which of the following CANNOT be a target for a custom attribute?

A. Enum
B. Event
C. Delegate
D. Interface
Answer» E.
28.

Which of the following is correct ways of applying an attribute?

A. [WebService (Name = "IndiaBIX", Description = "BIX WebService")] class AuthenticationService: WebService { /* .... */}
B. <WebService ( Name : "IndiaBIX", Description : "BIX WebService" )> class AuthenticationService: inherits WebService { /* .... */}
C. <WebService ( Name = "IndiaBIX", Description = "BIX WebService" )> class AuthenticationService: extends WebService { /* .... */}
D. [WebService ( Name := "IndiaBIX", Description := "BIX WebService")] class AuthenticationService: inherits WebService { /* .... */}
Answer» B. <WebService ( Name : "IndiaBIX", Description : "BIX WebService" )> class AuthenticationService: inherits WebService { /* .... */}
29.

The [Serializable()] attribute gets inspected at

A. Compile-time
B. Run-time
C. Design-time
D. Linking-time
Answer» C. Design-time