adplus-dvertising

Welcome to the Data Types,Variables and Operators MCQs Page

Dive deep into the fascinating world of Data Types,Variables and Operators with our comprehensive set of Multiple-Choice Questions (MCQs). This page is dedicated to exploring the fundamental concepts and intricacies of Data Types,Variables and Operators, a crucial aspect of C# Programming. In this section, you will encounter a diverse range of MCQs that cover various aspects of Data Types,Variables and Operators, from the basic principles to advanced topics. Each question is thoughtfully crafted to challenge your knowledge and deepen your understanding of this critical subcategory within C# Programming.

frame-decoration

Check out the MCQs below to embark on an enriching journey through Data Types,Variables and Operators. Test your knowledge, expand your horizons, and solidify your grasp on this vital area of C# Programming.

Note: Each MCQ comes with multiple answer choices. Select the most appropriate option and test your understanding of Data Types,Variables and Operators. You can click on an option to test your knowledge before viewing the solution for a MCQ. Happy learning!

Data Types,Variables and Operators MCQs | Page 3 of 14

Explore more Topics under C# Programming

Q21.
Which of the following are NOT Relational operators in C#.NET?

1. >=
2. !=
3. Not
4. <=
5. <>=
Discuss
Answer: (c).3, 5
Q22.
Which of the following is NOT a Bitwise operator in C#.NET?

a.

&

b.

|

c.

<<

d.

^

Discuss
Answer: (c).<<
Q23.
Which of the following statements is correct about the C#.NET code snippet given below?

int d; 
d = Convert.ToInt32( !(30 < 20) );
Discuss
Answer: (b).A value 1 will be assigned to d.
Q24.
Which of the following is the correct output for the C#.NET code snippet given below?

Console.WriteLine(13 / 2 + " " + 13 % 2);
Discuss
Answer: (d).6 1
Q25.
Which of the following statements are correct about the Bitwise & operator used in C#.NET?

1. The & operator can be used to Invert a bit.
2. The & operator can be used to put ON a bit.
3. The & operator can be used to put OFF a bit.
4. The & operator can be used to check whether a bit is ON.
5. The & operator can be used to check whether a bit is OFF.
Discuss
Answer: (d).3, 4, 5
Q26.
Which of the following are Logical operators in C#.NET?

1. &&
2. ||
3. !
4. Xor
5. %
Discuss
Answer: (a).1, 2, 3
Q27.
Suppose n is a variable of the type Byte and we wish, to check whether its fourth bit (from right) is ON or OFF. Which of the following statements will do this correctly?
Discuss
Answer: (b).if ((n&8) == 8)
Console.WriteLine("Fourth bit is ON");
Q28.
What will be the output of the C#.NET code snippet given below?
 
int num = 1, z = 5;

if (!(num <= 0))
    Console.WriteLine( ++num + z++ + " " + ++z ); 
else
    Console.WriteLine( --num + z-- + " " + --z );
Discuss
Answer: (d).7 7
Q29.
Suppose n is a variable of the type Byte and we wish to put OFF its fourth bit (from right) without disturbing any other bits. Which of the following statements will do this correctly?
Discuss
Answer: (c).n = n & 0xF7
Q30.
What will be the output of the C#.NET code snippet given below?

byte b1 = 0xAB;
byte b2 = 0x99;
byte temp;
temp = (byte)~b2;
Console.Write(temp + " ");
temp = (byte)(b1 << b2);
Console.Write (temp + " ");
temp = (byte) (b2 >> 2);
Console.WriteLine(temp);
Discuss
Answer: (c).102 0 38

Suggested Topics

Are you eager to expand your knowledge beyond C# Programming? We've curated a selection of related categories that you might find intriguing.

Click on the categories below to discover a wealth of MCQs and enrich your understanding of Computer Science. Happy exploring!