C# Questions Answers-C# loops (PartI)

C# loops (PartI)

1. The purpose of using a loop is to
a. Repeat operation(s) many times       b. make decision Check answer 2. Which of the C# loops is not a pretest loop?
a. for loop   b. while loop   c. do while loop Check answer 3. The break command is used to exit a loop.
a. True   b. False Check answer 4. Which of the followings is not a nested loop?
a. for(i=0;i<10;i++)
b. for(i=0;i<10;i++)
    for(j=1;j<i+2;j++) Console.Write("j={0}",j);
c. for(i=0;i<10;i++)
        while(j%2!=0){ Console.Write("{0}\t{1}", j, j++);}
Check answer 5. Which of the following statements about the while loop is not true?
a. The while loop is a posttest loop.
b. Testing condition is made before each iteration.
c. The while loop statement must terminate with a semi-colon.
Check answer


This website intents to provide free and high quality tutorials, examples, exercises and solutions, questions and answers of programming and scripting languages:
C, C++, C#, Java, VB.NET, Python, VBA,PHP & Mysql, SQL, JSP, ASP.NET,HTML, CSS, JQuery, JavaScript and other applications such as MS Excel, MS Access, and MS Word. However, we don't guarantee all things of the web are accurate. If you find any error, please report it then we will take actions to correct it as soon as possible.