gs gs108 Looping Statements - While Loop Statements - Quiz No.1
gs gs108 CSharp Quiz
This quiz belongs to book/course code gs gs108 CSharp of gs organization. We have 110 quizzes available related to the book/course CSharp. This quiz has a total of 10 multiple choice questions (MCQs) to prepare and belongs to topic Looping Statements. NVAEducation wants its users to help them learn in an easy way. For that purpose, you are free to prepare online MCQs and quizzes.
NVAEducation also facilitates users to contribute in online competitions with other students to make a challenging situation to learn in a creative way. You can create one to one, and group competition on an topic of a book/course code. Also on NVAEducation you can get certifications by passing the online quiz test.
static void Main(string[] args) { int i; i = 0; while (i++ < 5) { Console.WriteLine(i); } Console.WriteLine("\n"); i = 0; while ( ++i < 5) { Console.WriteLine(i); } Console.ReadLine(); }
1 2 3 4 1 2 3 4 5
1 2 3 1 2 3 4
1 2 3 4 5 1 2 3 4
1 2 3 4 5 1 2 3 4 5
static void Main(string[] args) { int x = 0; while (x < 20) { while (x < 10) { if (x % 2 == 0) { Console.WriteLine(x); } x++; } } Console.ReadLine(); }
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
static void Main(string[] args) { int x; x = Convert.ToInt32(Console.ReadLine()); int c = 1; while (c <= x) { if (c % 2 == 0) { Console.WriteLine("Execute While " + c + "\t" + "time"); } c++; } Console.ReadLine(); } for x = 8.
Execute while 1 time Execute while 3 time Execute while 5 time Execute while 7 time
Execute while 2 time Execute while 4 time Execute while 6 time Execute while 8 time
Execute while 1 time Execute while 2 time Execute while 3 time Execute while 4 time Execute while 5 time Execute while 6 time Execute while 7 time
Execute while 2 time Execute while 3 time Execute while 4 time Execute while 5 time
while { }(condition);
while(condition) { };
while(condition) { }
while(condition); { }
static void Main(string[] args) { int i = 0; while (i <= 50) { if (i % 10 == 0) continue; else break; i += 10; Console.WriteLine(i % 10); } }