Home / MCQ Bank / Computer
Computer Arrays And Strings In C Sharp Difficulty: Medium

What will be the output of the following C# code? class Program { static void Main(string[] args) { String []chars = {"z", "x", "y", "z", "y"}; for (int i = 0; i < chars.Length; ++i) for (int j = i + 1; j < chars.Length; ++j) if(chars[i].CompareTo(chars[j]) == 0) Console.WriteLine(chars[j]); Console.ReadLine(); } }

Select the correct option to test your answer:

More Computer Questions

What will be the output of the following C code? #include <stdio.h> #include <math.h> void main() { int k = fabs(-87); printf("%d\n", k); } What will be the output of the following C code? #include <stdio.h> void main() { int x = 4; int *p = &x; int *k = p++; int r = p - k; printf("%d", r); } Pick out the correct method in the c++ standard library algorithm. What does the "using" keyword do in the context of IDisposable objects in C#? A composite attribute is which of the following?