Home > Backend Development > C#.Net Tutorial > What does continue mean in C language?

What does continue mean in C language?

Guanhui
Release: 2020-06-19 11:13:50
Original
11068 people have browsed it

What does continue mean in C language?

#What does continue mean in C language?

continue in C language means to end this loop and proceed to the next loop. Its function is to jump out of the unexecuted statements below in the loop body. For while loops, continue to solve the loop conditions, and for for The loop program then evaluates the expression in the for statement header.

Recommended tutorial: "C#"

Code example

#include<stdio.h>
int main()
{
    int n;
    for(n=1;n<=10;n++)
    {
        if(n%3==0)
            continue;
        printf("%d\t",n);
    }
}
//其作用是:结束本次循环,即跳过循环体下面尚未执行的语句,接着进行下一次是否执行循环的判断.
Copy after login

Output results

1 2 4 5 7 8 10

continue is used in the loop structure to skip the remaining code in this loop and start executing the next loop when the condition evaluates to true.

Recommended article: "C#"

The above is the detailed content of What does continue mean in C language?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template