31 lines
726 B
Markdown
31 lines
726 B
Markdown
---
|
||
title: Continue statement
|
||
localeTitle: Продолжить вывод
|
||
---
|
||
# Продолжить вывод
|
||
|
||
Оператор `continue` передает управление следующей итерации внутри цикла.
|
||
|
||
В этом примере, когда значение i равно 2, следующий оператор в цикле пропускается.
|
||
|
||
## пример
|
||
```
|
||
int[] array = { 1, 2, 3, 4, 5 };
|
||
for (int i = 0; i < array.Length; i++)
|
||
{
|
||
if( i == 2)
|
||
{
|
||
continue;
|
||
}
|
||
Console.WriteLine("Item on index {0} is {1}", i, array[i]);
|
||
}
|
||
```
|
||
|
||
## Вывод:
|
||
```
|
||
> Item on index 0 is 1
|
||
> Item on index 1 is 2
|
||
> Item on index 3 is 4
|
||
> Item on index 4 is 5
|
||
|
||
``` |