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

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. A____block enclose the code that could throw an exception.

  • (A) Try
  • (B) Catch
  • (C) Exception
  • (D) Error

A

Admin • 833.24K Points
Coach

Q. An ____ is a group of contiguous or related data items that share a common name.

  • (A) Operator
  • (B) Integer
  • (C) Exponential
  • (D) Array

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. Code that targets the Common Language Runtime is known as

  • (A) Unmanaged
  • (B) Distributed
  • (C) Managed Code
  • (D) Native Code

A

Admin • 833.24K Points
Coach

Q. Which of the following statements correctly define .NET Framework?

  • (A) It is an environment for developing, building, deploying and executing Desktop Applications, Web Applications and Web Services.
  • (B) It is an environment for developing, building, deploying and executing only Web Applications.
  • (C) It is an environment for developing, building, deploying and executing Distributed Applications.
  • (D) It is an environment for developing, building, deploying and executing Web Services.

A

Admin • 833.24K Points
Coach

Q. How many types of compilers availbale under CLR?

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

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. What will be the output of the following code snippet when it is executed?
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 statements are correct?
1. We can assign values of any type to variables of type object.
2. When a variable of a value type is converted to object, it is said to be unboxed.
3. When a variable of type object is converted to a value type, it is said to be boxed.
4. Boolean variable cannot have a value of null.
5. When a value type is boxed, an entirely new object must be allocated and constructed.

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

A

Admin • 833.24K Points
Coach

Q. Which of the following can be used to terminate a while loop and transfer control outside the loop?
1. exit while
2. continue
3. exit statement
4. break
5. goto

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

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