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 14 of 14

Q131.
Select the relevant output for the following set of code :
static void Main(string[] args)
 {
     byte varA = 10;
     byte varB = 20;
     long result = varA & varB;
     Console.WriteLine("{0}  AND  {1} Result :{2}", varA, varB, result);
     varA = 10;
     varB = 10;
     result = varA & varB;
     Console.WriteLine("{0}  AND  {1} Result : {2}", varA, varB, result);
     Console.ReadLine();
 }
Discuss
Answer: (c).0, 10
Q132.
Select the relevant output for the following set of code :
public static void Main() 
 {
     byte varA = 10;
     byte varB = 20;
     long result = varA | varB; 
     Console.WriteLine("{0}  OR  {1} Result :{2}", varA, varB, result);
     varA = 10;
     varB = 10;
     result = varA | varB;  
     Console.WriteLine("{0}  OR  {1} Result : {2}", varA, varB, result);
 }
Discuss
Answer: (b).30, 10
Q133.
Select the output for the following set of Code:
static void Main(string[] args)
 {
     byte b1 = 0 * AB;
     byte b2 = 0 * 99;
     byte temp;
     temp = (byte) ~b2;
     Console.Write( temp + " ");
     temp = (byte) (b1 << b2);
     Console.Write(temp + " ");
     temp = (byte)(b2  >> 2);
     Console.WriteLine(temp);
     Console.ReadLine();
 }
Discuss
Answer: (c).102 0 38
Q134.
Which of the following options is not a Bitwise Operator in C#?
Discuss
Answer: (d).+=, -=
Q135.
Select the output for the following set of Code:
bool a = true;
  bool b = false;
  a |= b;
  Console.WriteLine(a);
  Console.ReadLine();
Discuss
Answer: (c).True
Q136.
Select the relevant code set to fill up the blank for the following program :
static void Main(string[] args)
  {
      int x = 10, y = 20;
      int res;
      /*_______________*/ 
      Console.WriteLine(res);
  }
Discuss
Answer: (b).x % y == 0 ? y += 10:(x += 10);
Q137.
Select the output for the following set of code:
static void Main(string[] args)
 {
     int y = 5;
     int x;
     int k = (!(Convert.ToInt32(y) > 10))?  x = y + 3 : x = y + 10;
     Console.WriteLine(x);
     Console.WriteLine(y);
     Console.ReadLine();
 }
Discuss
Answer: (c).8, 5
Q138.
Which among the following is a conditional operator ?
Discuss
Answer: (c).?:
Q139.
Select the Output for the following set of code :
public static void Main(string[] args)
{
    int a = 4;
    int c = 2;
    bool b = (a % c == 0 ? true : false);
    Console.WriteLine(b.ToString());
    if (a/c == 2)
    {
        Console.WriteLine("true");
    }
    else
    {
        Console.WriteLine("false");
    }
    Console.ReadLine();
}
Discuss
Answer: (c).True
True
Q140.
Arrange the operators in the increasing order as defined in C#:
!=, ?:, &, ++, &&
Discuss
Answer: (c).?: < && < & <!= < ++
Page 14 of 14

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!