Explore topic-wise MCQs in Csharp.

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

1.

Correct way to assign values to variable ‘c’ when int a=12, float b=3.5,int c?#

A. c = a + b;
B. c = a + int(float(b));
C. c = a + convert.ToInt32(b);
D. c = int(a + b);
Answer» D. c = int(a + b);
2.

Which Conversion function of ‘Convert.TOInt32()’ and ‘Int32.Parse()’ is efficient?$

A. Int32.Parse() is only used for strings and throws argument exception for null string
B. Convert.Int32() used for data types and returns directly ‘0’ for null string
C. 2
D. Both 1,2
Answer» D. Both 1,2
3.

‘k’ should not be declared constant$

A. Expression assigned to ‘k’ should be constant in nature
B. Expression (m * k) is invalid
C. ‘m ‘ is declared in invalid format
Answer» C. ‚Äö√Ñ√∂‚àö√ë‚àö‚â§m ‚Äö√Ñ√∂‚àö√ë‚àö‚â§ is declared in invalid format
4.

Correct Declaration of Values to variables ‘a’ and ‘b’?$

A. int a = 32, b = 40.6;
B. int a = 42; b = 40;
C. int a = 32; int b = 40;
D. int a = b = 42;
Answer» D. int a = b = 42;
5.

Choose “.NET class” name from which data type “UInt” is derived ?$

A. System.Int16
B. System.UInt32
C. System.UInt64
D. System.UInt16
Answer» C. System.UInt64
6.

How many Bytes are stored by ‘Long’ Data type in C# .net?

A. 8
B. 4
C. 2
D. 1
Answer» B. 4