Question
char[ ] arr = new char[ ] {'k', 'i','C', 'i','t'} ;
a.
do
{
Console.WriteLine((char) i);
}
while (int i = 0; i < arr; i++);
b.
foreach (int i in arr)
{
Console.WriteLine((char) i);
}
c.
for (int i = 0; i < arr; i++)
{
Console.WriteLine((char) i);
}
d.
while (int i = 0; i < arr; i++)
{
Console.WriteLine((char) i);
}
Posted under C# programming
{
Console.WriteLine((char) i);
}
Engage with the Community - Add Your Comment
Confused About the Answer? Ask for Details Here.
Know the Explanation? Add it Here.
Q. Which of the following loop correctly prints the elements of the array?
Similar Questions
Discover Related MCQs
Q. Which of the following statements are correct?
1. A switch statement can act on numerical as well as Boolean types.
2. A switch statement can act on characters, strings and enumerations types.
3. We cannot declare variables within a case statement if it is not enclosed by { }.
4. The foreach statement is used to iterate through the collection to get the desired information and should be used to change the contents of the collection to avoid unpredictable side effects.
5. All of the expressions of the for statement are not optional.
View solution
Q. Which of the following is the incorrect form of Decision Control instruction?
View solution
Q. Which of the following statements is correct?
View solution
Suggested Topics
Are you eager to expand your knowledge beyond C# programming? We've curated a selection of related categories that you might find intriguing.
Click on the categories below to discover a wealth of MCQs and enrich your understanding of Computer Science. Happy exploring!