int val; for (val = -5; val <= 5; val++) { switch (val) { case 0: Console.Write ("India"); break; } if (val > 0) Console.Write ("B"); else if (val < 0) Console.Write ("X"); }
int i; for(i = 0; i<=10; i++) { if(i == 4) { Console.Write(i + " "); continue; } else if (i != 4) Console.Write(i + " "); else break; }
if (age > 18 && no < 11) a = 25;
int i = 2, j = i; if (Convert.ToBoolean((i | j & 5) & (j - 25 * 1))) Console.WriteLine(1); else Console.WriteLine(0);
char ch = Convert.ToChar ('a' | 'b' | 'c'); switch (ch) { case 'A': case 'a': Console.WriteLine ("case A | case a"); break; case 'B': case 'b': Console.WriteLine ("case B | case b"); break; case 'C': case 'c': case 'D': case 'd': Console.WriteLine ("case D | case d"); break; }
int i, j, id = 0; switch (id) { case i: Console.WriteLine("I am in Case i"); break; case j: Console.WriteLine("I am in Case j"); break; }
switch (id) { case 6: grp = "Grp B"; break; case 13: grp = "Grp D"; break; case 1: grp = "Grp A"; break; case ls > 20: grp = "Grp E"; break ; case Else: grp = "Grp F"; break; }
Copyright ©CuriousTab. All rights reserved.