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

Q81.
Select the output for the following set of code :
static void Main(string[] args)
   {
       int i = 10 , j = 0;
       label:
       i--;
       if ( i > 0)
       {
           Console.WriteLine(i+ " ");
           goto label;
       }
       Console.ReadLine();
   }
Discuss
Answer: (c).9 8 7 6 5 4 3 2 1
Q82.
Select the output for the following set of code :
static void Main(string[] args)
  {
      int i = 0, j = 0;
      while (i < 2)
      {
          l1: i--;
          while (j < 2)
          {
              Console.WriteLine("hi\n");
              goto l1;
          }
      }
      Console.ReadLine();
  }
Discuss
Answer: (d).hi hi hi…..infinite times
Q83.
Select the output for the following set of code :
static void Main(string[] args)
  {
      int i = 0;
      if (i == 0)
      {
          goto label;
      }
      label: Console.WriteLine("HI...");
      Console.ReadLine();
  }
Discuss
Answer: (d).Hi…
Q84.
Select the output for the following set of code :
static void Main(string[] args)
  {
      int i = 0, j = 0;
      l1: while (i < 2)
      {  
          i++;
          while (j < 3)
          {
              Console.WriteLine("loop\n");
              goto l1;
          }
       }
      Console.ReadLine();
  }
Discuss
Answer: (c).loop loop
Q85.
Select output for the following set of code :
static void Main(string[] args)
  {
      int i= 0,k;
      label: Console.WriteLine(i);
      if (i == 0)
          goto label;
      Console.ReadLine();
  }
Discuss
Answer: (c).0 infinite times
Q86.
Select the output for the following set of code :
static void Main(string[] args)
   {
       int i = 0;
       int j = 0;
       for (i = 0; i < 4; i++)
       {
           for (j = 0; j < 3; j++)
           {
               if (i > 1)
                   continue;
               Console.WriteLine("Hi \n");
           }
       }
       Console.ReadLine();
   }
Discuss
Answer: (c).Prints hi 6 times
Q87.
Select the output for the following set of code :
static void Main(string[] args)
    {
        int a = 0;
        int i = 0;
        int b;
        for (i = 0; i < 5; i++)
        {
             a++;
             Console.WriteLine("Hello \n");
             continue;
        }
        Console.ReadLine();
    }
Discuss
Answer: (c).print hello 5 times
Q88.
Select the output for the set of code:
static void Main(string[] args)
    {
        Console.WriteLine("HI");
        continue;
        Console.WriteLine("Hello");
        Console.ReadLine();
    }
Discuss
Answer: (d).Compile time error
Page 9 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!