Home / MCQ Bank / Computer
Computer Control Flow Statements In C Sharp

What will be the output of the following C# code? static void Main(string[] args) { int i = 1, j; do { for (j = 1; ; j++) { if (j > 2) break; if (i == j) continue; Console.WriteLine(i + " " + j); } i++; } while (i < 3); Console.ReadLine(); }

Select the best option to verify your answer:
Show Correct Answer
Correct Answer: Option A • 1 2 2 1

Related Computer Questions

Which algorithm in C++ STL is used to find the union of two sorted ranges? If expression. The expression can be of which type? Which of the following option is wrong about natural numbers? ______ is a utility which allows users to create and run jobs with any executables as the mapper and/or the reducer. Consider the following recursive implementation of the rod cutting problem: #include<stdio.h> #include<limits.h> int max_of_two(int a, int b) { if(a > b) return a; return b; } int rod_cut(int *prices, int len) { int max_price = INT_MIN; // INT_MIN is the min value an integer can take int i; if(len <= 0 ) return 0; for(i = 0; i < len; i++) max_price = max_of_two(_____________); // subtract 1 because index starts from 0 return max_price; } int main() { int prices[]={2, 5, 6, 9, 9, 17, 17, 18, 20, 22},len_of_rod = 10; int ans = rod_cut(prices, len_of_rod); printf("%d",ans); return 0; } Complete the above code.