MCQOPTIONS
Saved Bookmarks
| 1. |
What will be the output of the given code snippet? 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(); } } |
| A. | Zx |
| B. | Xy |
| C. | Zy |
| D. | Yz |
| Answer» D. Yz | |