mjc65

Example 1-68. A for loop with a continue statement

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