Advertisement
mjc65

Example 1-69. Implementing a for loop with a while statement

Jun 23rd, 2020
540
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.17 KB | None | 0 0
  1. int[] values = { 1, 2, 3, 4, 5, 6 };
  2.  
  3. {
  4.     int index = 0;
  5.     while (index < values.Length)
  6.     {
  7.         Console.Write(values[index]);
  8.         index++;
  9.     }
  10. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement