Advertisement
nahidjamalli

Lesson #2

Feb 16th, 2020
229
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.90 KB | None | 0 0
  1. namespace MyNamespace
  2. {
  3.     class Program
  4.     {
  5.         static void Main(string[] args)
  6.         {
  7.             // The first is check condition then operations
  8.             while (true) // boolean expression
  9.             {
  10.                 break;
  11.             }
  12.  
  13.             // The first is to do operations and then check condition
  14.             do
  15.             {
  16.                 break;
  17.             } while (true); // boolean expression
  18.  
  19.             int a = 3;
  20.             switch (a)
  21.             {
  22.                 case 1: System.Console.WriteLine("CASE #1"); break;
  23.                 case 2: System.Console.WriteLine("CASE #2"); break;
  24.                 case 3:
  25.                     System.Console.WriteLine("CASE #3");
  26.                     System.Console.WriteLine("CASE #4");
  27.                     break;
  28.                 default: System.Console.WriteLine("DEFAULT"); break;
  29.             }
  30.         }
  31.     }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement