C# (C Sharp) MCQs with answers Page - 5

Here, you will find a collection of MCQ questions on C# (C Sharp). Go through these questions to enhance your preparation for upcoming examinations and interviews.

To check the correct answer, simply click the View Answer button provided for each question.

Have your own questions to contribute? Click the button below to share your MCQs with others!

+ Add Question

A

Admin • 833.24K Points
Coach

Q. ___________ namespace is not defined in the .NET class library.

  • (A) System.CodeDom
  • (B) System
  • (C) System.IO
  • (D) System.Text

A

Admin • 833.24K Points
Coach

Q. Dot Net Framework consists of :

  • (A) Common language runtime
  • (B) Set of class libraries
  • (C) Common language runtime and set of class libraries
  • (D) None of above

A

Admin • 833.24K Points
Coach

Q. Which of the following statements are correct about JIT?
1. JIT compiler compiles instructions into machine code at run time.
2. The code compiler by the JIT compiler runs under CLR.
3. The instructions compiled by JIT compilers are written in native code.
4. The instructions compiled by JIT compilers are written in Intermediate Language (IL) code.

  • (A) 1,2,3
  • (B) 2,4
  • (C) 3,4
  • (D) 1,2

A

Admin • 833.24K Points
Coach

Q. Which of the following is the root of the .NET type hierarchy?

  • (A) System.Type
  • (B) System.Base
  • (C) System.Parent
  • (D) System.Object

A

Admin • 833.24K Points
Coach

Q. How many types of compilers available under CLR?

  • (A) 4
  • (B) 2
  • (C) 1
  • (D) 3

A

Admin • 833.24K Points
Coach

Q. Which of the following utilities can be used to compile managed assemblies into processor-specific native code?

  • (A) gacutil
  • (B) ngen
  • (C) sn
  • (D) ildasm

A

Admin • 833.24K Points
Coach

Q. Which of the following statements are correct about data types?
1. If the integer literal exceeds the range of byte, a compilation error will occur.
2. We cannot implicitly convert non-literal numeric types of larger storage size to byte.
3. Byte cannot be implicitly converted to float.
4. A char can be implicitly converted to only int data type.
5. We can cast the integral character codes.

  • (A) 1,3,5
  • (B) 2,4
  • (C) 3,5
  • (D) 1,2,5

A

Admin • 833.24K Points
Coach

Q. Which of the following is NOT an Integer?

  • (A) Char
  • (B) Byte
  • (C) Integer
  • (D) Long

A

Admin • 833.24K Points
Coach

Q. What will be the output of the following code snippet when it is
executed?

Code:
int x = 1; float y = 1.1f; short z = 1; Console.Write.Line((float) x +
y * z - (x += (short) y));
  • (A) 0.1
  • (B) 1.0
  • (C) 1.1
  • (D) 11

A

Admin • 833.24K Points
Coach

Q. Which of the following is the correct size of a Decimal datatype?

  • (A) 8 bytes
  • (B) 4 bytes
  • (C) 10 bytes
  • (D) None of the above

Add MCQ in this Category

If you want to share an MCQ question in this category, it's a great idea! It will be helpful for many other students using this website.

Share Your MCQ