Advertisement
ChaosTheosis

Do While Loop

Jan 25th, 2015
238
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.53 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. //The do while loop will first execute the statement then check the code. A guarenteed execute.
  8.  
  9. namespace Tutorial_Project_1.Tutorial_1_Examples
  10. {
  11.     class Do_While_Loop
  12.     {
  13.         static void Main()
  14.         {
  15.             int x = 10;
  16.  
  17.              do
  18.           {
  19.               Console.WriteLine("x = " + x);
  20.            
  21.                  x--;
  22.  
  23.           } while (x > 0);
  24.        }
  25.     }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement