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

Q111.
Predict the output for the following set of code.
static void Main(string[] args)
 {
     float a = 16.4f;
     int b = 12;
     float c;
     c =  a * ( b + a) / (a - b) ;
     Console.WriteLine("result is :" +c);
     Console.ReadLine();
 }
Discuss
Answer: (c).105.8546
Q112.
Predict the solution for the following set of code.
static void Main(string[] args)
  {
      int a, b, c, x;
      a = 90;
      b = 15;
      c = 3;
      x = a - b / 3 + c * 2 - 1;
      Console.WriteLine(x);
      Console.ReadLine();
  }
Discuss
Answer: (c).90
Q113.
Predict the solution for the following set of code .
static void Main(string[] args)
  {
      int a, b, c, x;
      a = 80;
      b = 15;
      c = 2;
      x = a - b / (3 * c) * ( a + c);
      Console.WriteLine(x);
      Console.ReadLine();
  }
Discuss
Answer: (b).-84
Discuss
Answer: (c).‘*’ > ‘/’ > ‘%’ > ‘+’
Q115.
Predict the output for the given snippet of code :
int i, j = 1, k;
    for (i = 0; i < 3; i++)
    {
        k = j++ - ++j;
        Console.Write(k + " ");
    }
Discuss
Answer: (c).-2 -2 -2
Q116.
Predict the output for the given set of code correctly.
static void Main(string[] args)
  {
      int b= 11;
      int c = 7;
      int r = 5;
      int e = 2;
      int l;
      int v = 109;
      int k;
      int z,t,p;
      z = b * c;
      t = b * b;
      p = b * r * 2;
      l = (b * c) + (r * e) + 10;
      k = v - 8;
      Console.WriteLine(Convert.ToString(Convert.ToChar(z)) + " " + Convert.ToString(Convert.ToChar(t)) + Convert.ToString(Convert.ToChar(p)) +   Convert.ToString(Convert.ToChar(l)) + Convert.ToString(Convert.ToChar(v)) + Convert.ToString(Convert.ToChar(k)));                
      Console.ReadLine();
  }
Discuss
Answer: (c).My name
Q117.
Predict the output for the following set of code :
static void Main(string[] args)
 {
     int n = 5;
     int x = 4;
     int z, c, k;
     for (c = 1; c <= n; c++)
     {
         for (k = 1; k <= c; k++)
     {
         z = 3 * x * x + 2 * x + 4 / x + 8;
         Console.Write(Convert.ToString(Convert.ToChar(z)));
     }
         Console.WriteLine("\n");
     }
     Console.ReadLine();
 }
Discuss
Answer: (c).A
AA
AAA
AAAA
AAAAA
Q118.
Predict the output for the following set of code :
static void Main(string[] args)
 {
     int n = 5;
     int x = 4;
     int z, c, k;
     z = 3 * x * x + 2 * x + 4 / x + 8;
     for (c = 1; c <= n; c++)
     {
         for (k = 1; k <= c; k++)
         {
             Console.Write(Convert.ToString(Convert.ToChar(z)));
             z++;
         }
         Console.WriteLine("\n");
     }
     Console.ReadLine();
 }
Discuss
Answer: (c).A
BC
DEF
GHIJ
KLMNO
Q119.
Choose exact solution for the following code snippet :
static void Main(string[] args)
  {
      int a , b;
      int c = 10;
      int d = 12;
      int e = 5;
      int f = 6;
      a = c * (d + e) / f + d;
      Console.WriteLine(a);
      b = c * ( d + e / f + d);
      Console.WriteLine(b);
      if (a < b)
      {
          Console.WriteLine(" parantheses changes values");
      }
      else if (a > b)
      {
          Counterintelligence("they have same value");
      }
      Console.ReadLine();
  }
Discuss
Answer: (b).Parentheses changes values
Q120.
The correct way of incrementing the operators are :
Discuss
Answer: (c).c += 1

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!