C# Programming - Operators

Exercise : Operators - General Questions
  • Operators - General Questions
1.
Which of the following are the correct ways to increment the value of variable a by 1?
  1. ++a++;
  2. a += 1;
  3. a ++ 1;
  4. a = a +1;
  5. a = +1;
1, 3
2, 4
3, 5
4, 5
None of these
Answer: Option
Explanation:
No answer description is available. Let's discuss.

2.
What will be the output of the C#.NET code snippet given below?
byte b1 = 0xF7;
byte b2 = 0xAB;
byte temp;
temp = (byte)(b1 & b2);
Console.Write (temp + " ");
temp = (byte)(b1^b2);
Console.WriteLine(temp);
163 92
92 163
192 63
0 1
Answer: Option
Explanation:
No answer description is available. Let's discuss.

3.
Which of the following is NOT an Arithmetic operator in C#.NET?
**
+
/
%
*
Answer: Option
Explanation:
No answer description is available. Let's discuss.

4.
Which of the following are NOT Relational operators in C#.NET?
  1. >=
  2. !=
  3. Not
  4. <=
  5. <>=
1, 3
2, 4
3, 5
4, 5
None of these
Answer: Option
Explanation:
No answer description is available. Let's discuss.

5.
Which of the following is NOT a Bitwise operator in C#.NET?
&
|
<<
^
~
Answer: Option
Explanation:
No answer description is available. Let's discuss.