gs gs108 Looping Statements - Continue, Goto 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; Console.WriteLine("enter value of i:"); i = Convert.ToInt32(Console.ReadLine()); if ( i % 2 == 0) goto even: else { Console.WriteLine("number is odd:"); Console.ReadLine(); } even: Console.WriteLine("number is even:"); Console.ReadLine(); } for i = 4.
static void Main(string[] args) { int i = 10 , j = 0; label: i--; if ( i > 0) { Console.WriteLine(i+ " "); goto label; } Console.ReadLine(); }
static void Main(string[] args) { int i = 0; if (i == 0) { goto label; } label: Console.WriteLine("HI..."); Console.ReadLine(); }
static void Main(string[] args) { int i = 0, j = 0; l1: while (i < 2) { i++; while (j < 3) { Console.WriteLine("loop\n"); goto l1; } } Console.ReadLine(); }
static void Main(string[] args) { int i = 0; int j = 0; for (i = 0; i < 4; i++) { for (j = 0; j < 3; j++) { if (i > 1) continue; Console.WriteLine("Hi \n"); } } Console.ReadLine(); }
static void Main(string[] args) { int a = 0; int i = 0; int b; for (i = 0; i < 5; i++) { a++; Console.WriteLine("Hello \n"); continue; } Console.ReadLine(); }