C# Programming - Control Instructions - Discussion

Discussion Forum : Control Instructions - General Questions (Q.No. 20)
20.
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++);
Answer: Option
Explanation:
No answer description is available. Let's discuss.
Discussion:
3 comments Page 1 of 1.

Abhi said:   10 years ago
It will be char not chart.
(1)

Kubra said:   3 years ago
I think it will be char, not int.

Rajesh said:   2 years ago
Here, It should be char instead of int.

Post your comments here:

Your comments will be displayed after verification.