ExamVeda
Login
Home
21
What is the purpose of the 'using' directive in C#?
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
22
Which operator is used for concatenation of strings in C#?
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
23
What is the output of the following code: Console.WriteLine(5 + 7 * 2);
Discuss
Answer & Solution
Answer: Option B
Solution:
Understanding the Question:
This question tests your understanding of operator precedence in C#. Operator precedence determines the order in which operations are performed in a calculation.

Operator Precedence in C#:
In C#, multiplication (*) has higher precedence than addition (+). This means that multiplication is done before addition.

Solving the Problem:
Let's break down the expression Console.WriteLine(5 + 7 * 2);
1. First, the multiplication 7 * 2 is performed: 7 * 2 = 14
2. Next, the addition 5 + 14 is performed: 5 + 14 = 19
3. Finally, Console.WriteLine() displays the result, which is 19.

Therefore:
The correct answer is Option B: 19
24
What is the result of the expression 10 % 3 in C#?
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
25
What does the 'new' keyword do in C#?
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
26
Which of the following is NOT a valid C# comment style?
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
27
In C#, what is the purpose of the 'static' keyword for class members?
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
28
What is the keyword used to exit a loop prematurely in C#?
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
29
What is the correct syntax to define a method in C#?
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
30
Which of the following is NOT a valid C# data type?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board