Curioustab
Aptitude
General Knowledge
Verbal Reasoning
Computer Science
Interview
Aptitude
General Knowledge
Verbal Reasoning
Computer Science
Interview
Home
»
C# Programming
»
Control Instructions
Which of the following loop correctly prints the elements of the array? char[ ] arr = new char[ ] {'k', 'i','C', 'i','t'} ;
do { Console.WriteLine((char) i); } while (int i = 0; i < arr; i++);
foreach (int i in arr) { Console.WriteLine((char) i); }
for (int i = 0; i < arr; i++) { Console.WriteLine((char) i); }
while (int i = 0; i < arr; i++) { Console.WriteLine((char) i); }
do { Console.WriteLine((char) i); } until (int i = 0; i < arr; i++);
Show Answer
Correct Answer:
foreach (int i in arr) { Console.WriteLine((char) i); }
← Previous
Next →
Discussion & Comments
No comments yet. Be the first to comment!
Name:
Comment:
Post Comment