0% found this document useful (0 votes)
15 views5 pages

Break and Continue Statements in C - C Tutorial in Hindi #16 - CodeWithHarry

The document provides an overview of break and continue statements in the C programming language, explaining their functions and usage within loops and switch cases. The break statement exits the loop or switch, while the continue statement skips to the next iteration of the loop. Syntax examples are included to illustrate how these statements are implemented in C code.

Uploaded by

RiTURAJ
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views5 pages

Break and Continue Statements in C - C Tutorial in Hindi #16 - CodeWithHarry

The document provides an overview of break and continue statements in the C programming language, explaining their functions and usage within loops and switch cases. The break statement exits the loop or switch, while the continue statement skips to the next iteration of the loop. Syntax examples are included to illustrate how these statements are implemented in C code.

Uploaded by

RiTURAJ
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

CodeWithHarry

Break and Continue Statements In C: C Tutorial In Hindi #16

Course: C Language Tutorials For Beginners

Coding Rock, Paper, Scissors In C Exercise 9: C Tutorial In Hindi #51

Void Pointer In C Language: C Tutorial In Hindi #52

NULL Pointer In C Language: C Tutorial In Hindi #53

Overview Q&A Downloads Announcements

Break and Continue Statements In C: C Tutorial In Hindi #16

Break Statement :
Break statement is used to break the loop or switch case statements execution
and brings the control to the next block of code after loop or switch case.
Break statements are used to bring the program control out of the loop.
The break statement is used inside loops or switch statement in C Language.

Syntax for Break statement :

#include<stdio.h>
int main()
{
int i,age;
for(i = 0 ; i < 5 ; i++) \
{

printf("Iteration time = %d\nEnter Your Age : ",i );


scanf("%d",&age);
if (age>10)
{
break; // Checking Break Statement
}
// if(age<10)
//{ continue; }
//printf("Hey Guys\n");
//printf("This code is printed coz if condition is not satisfie
// printf("Checking Continue Statement\n\n"); // Checking Contin
} return 0;
}
Crack System Design Interview
learn data structure &
Algorithms using JAVA,
C, C++, PYTHON, C#

Continue Statement :
The continue statement is used inside loops in C Language. When a continue
statement is encountered inside the loop, control jumps to the beginning of the
loop for next iteration, skipping the execution of statements inside the body of
loop after continue statement.
It is used to bring the control to the next iteration of the loop.
The continue statement skips some code inside the loop and continues with the
next iteration.
It is mainly used for a condition so that we can skip some lines of code for a
particular condition.
It forces next iteration in loop i.e. as break terminates the loop but continue forces
the next iteration of the loop.

Syntax for Continue statement :

#include<stdio.h>
int main()
{
int i,age;
for(i = 0 ; < ++)
{
printf("Iteration time %d\nEnter Your Age : ",i );
scan“"%d",& );
// if (age>10)
// {
// break; // Checking Break Statement
// }
if(age<10)
{ continue; }
printf("Hey Guys\n");
printf("This code is printed coz if condition is not satisfied.
printf("Checking Continue Statement\n\n"); // Checking Continue
}
return 0;
}

That's all about Break and Continue Statements in C Language.

Crack System Design Interview


learn data structure &
Algorithms using JAVA,
C, C++, PYTHON, C#

Code as described/written in the video

#include <stdio.h>

int main()
{
printf("Hello World\n");
int i, age;
for (i=0; i<10; i++){
printf("%d\nEnter your age\n", i);
scanf("%d", &age);
// if (age>10)
// {
// break;
// }
if (age>10)
{
continue;
}
printf("we have not come accross any continue statements");
printf("we have not come accross any continue statements");
printf("we have not come accross any continue statements");
printf("we have not come accross any continue statements");
printf("Harry is a good boy");

return 0;
}

Previous Next

CodeWithHarry

Copyright © 2022 CodeWithHarry.com

You might also like