C# Programming MCQs

Q1) Arrange the following data type in order of increasing magnitude sbyte, short, long, int.

A – long < short < int < sbyte

B – sbyte < short < int < long

C – short < sbyte < int < long

D – short < int < sbyte < long

Answer: B

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

A – System.Int16

B – System.UInt32

C – System.UInt64

D – System.UInt16

Answer: B

Q3) 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: C

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

A – 8

B – 4

C – 2

D – 1

Answer: A

Q5) Which data type should be more preferred for storing a simple number like 35 to improve execution speed of a program?

A – sbyte

B – short

C – int

D – long

Answer: A

error: Content is protected !!