Advertisement
mjc65

xample 1-66. A for loop with a custom increment

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