adplus-dvertising

Welcome to the Control Instructions MCQs Page

Dive deep into the fascinating world of Control Instructions with our comprehensive set of Multiple-Choice Questions (MCQs). This page is dedicated to exploring the fundamental concepts and intricacies of Control Instructions, a crucial aspect of C# programming. In this section, you will encounter a diverse range of MCQs that cover various aspects of Control Instructions, 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 Control Instructions. 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 Control Instructions. You can click on an option to test your knowledge before viewing the solution for a MCQ. Happy learning!

Control Instructions MCQs | Page 6 of 9

Explore more Topics under C# programming

Q51.
Predict the output for the following set of code :
static void Main(string[] args)
   {
       int i;
       for (i =-3; i <= 3; i++)
       {
           switch (i)
           {
           case 0:
               Console.WriteLine("zero");
               break;
           }
           if (i > 0)
               Console.WriteLine("A");
           else if (i < 0)
               Console.WriteLine("B");
       }
       Console.ReadLine();
   }
Discuss
Answer: (c).B B B zero A A A
Discuss
Answer: (b).for( ;โ€™0โ€ฒ; )
Q53.
Select the output for the following set of code :
static void Main(string[] args)
  {
      int i, j;
      for (i = 1, j = i; i <= 3 && j >= 0; i++, j--)
      {
          if (i == j)
              continue;
          else
              Console.WriteLine(j);
      }
      Console.ReadLine();
  }
Discuss
Answer: (c).j = 0;
Q54.
Select the output for the following set of code :
static void Main(string[] args)
 {
     int i = -10;
     for ( ;Convert.ToBoolean(Convert.ToInt32(i)) ;Console.WriteLine(i++)) ;
     Console.ReadLine();
 }
Discuss
Answer: (c).-10 -9 -8 -7 -6 -5 -4 -3 -2 -1
Q55.
Select the output for the following set of code :
static void Main(string[] args)
 {
     int i, j;
     for (i = 1; i <= 3; i++)
     {
         j = 1;
         while (i % j == 2)
         {
             j++;
         }
         Console.WriteLine(i + " " + j);
     }
     Console.ReadLine();
 }
Discuss
Answer: (c).11 21 31
Q56.
Select the output for the following set of code:
static void Main(string[] args)
 {
     float s = 0.1f;
     while (s <= 0.5f)
     {
         ++s;
         Console.WriteLine(s);
     }
     Console.ReadLine();
 }
Discuss
Answer: (b).1.1
Q57.
Select the output for the following set of Code:
static void Main(string[] args)
 {
     int i;
     i = 0;
     while (i++ < 5)
     {
         Console.WriteLine(i);
     }
     Console.WriteLine("\n");
     i = 0;
     while ( ++i < 5)
    {
        Console.WriteLine(i);
    }
    Console.ReadLine();
}
Discuss
Answer: (c).1 2 3 4 5
1 2 3 4
Q58.
Select the output for the following set of Code:
static void Main(string[] args)
 {
     int x = 0;  
     while (x < 20)
     {
         while (x < 10)
         {
             if (x % 2 == 0)
             {
                 Console.WriteLine(x);
             }
             x++;
         }
     }
     Console.ReadLine();
 }
Discuss
Answer: (c).0 2 4 6 8
Q59.
Predict the output for the following set of code :
static void Main(string[] args)
 {
     int x;
     x = Convert.ToInt32(Console.ReadLine());
     int c = 1;
     while (c <= x)
     {
         if (c % 2 == 0)
         {
             Console.WriteLine("Execute While " + c + "\t" + "time");
         }
         c++;
     }
     Console.ReadLine();
 }
for x = 8.
Discuss
Answer: (b).Execute while 2 time
Execute while 4 time
Execute while 6 time
Execute while 8 time
Q60.
Select the output for the following set of Code:
static void Main(string[] args)
  {
      int n, r;
      n = Convert.ToInt32(Console.ReadLine());
      while (n > 0)
      {
          r = n % 10;
          n = n / 10;
          Console.WriteLine(+r);
      }
      Console.ReadLine();
  }
 for n = 5432.
Discuss
Answer: (c).2345
Page 6 of 9

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!