C# QUIZ 4

4
Created on By Sirjana GhimireAcharya

C# Quiz 4

1 / 10

  1. Which of the following property of Array class in C# gets a 64-bit integer, the total number of elements in all the dimensions of the Array?

2 / 10

2. 10 > 9 ? "10 is greater than 9” : "9 is greater than 10” is an example of _______

3 / 10

3. Which of the following gives the correct count of the constructors that a class can define?

4 / 10

4. What will be the output of the following code snippet?

class program
{
static void Main(string[] args)
{
int num = 2;
fun1 (ref num);
Console.WriteLine(num);
Console.ReadLine();
}
static void fun1(ref int num)
{
num = num * num * num;
}
}

5 / 10

5. What is the output of this C# code?

int? i = 8 >> 5;
int? j = i > 0 ? i : null;
var a = j ?? int.MinValue;
Console.WriteLine(a);

6 / 10

6. Find a correct statement about C# exception

7 / 10

7. Find an invalid Main() method prototype, which is entry point in C#?

8 / 10

8. An array in C# starts with _____ index.

9 / 10

9.  Find an invalid example of using C# var

10 / 10

10. Which datatype should be more preferred for storing a simple number like 35 to improve execution speed of a program ?

Your score is

The average score is 13%

0%