0% found this document useful (0 votes)
3 views3 pages

Repetition Structure 03

The document explains the differences between the break and continue keywords in programming. The break keyword exits the current loop and terminates it prematurely, while the continue keyword skips the current iteration and moves to the next one. Two example codes illustrate the usage of each keyword in a loop context.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views3 pages

Repetition Structure 03

The document explains the differences between the break and continue keywords in programming. The break keyword exits the current loop and terminates it prematurely, while the continue keyword skips the current iteration and moves to the next one. Two example codes illustrate the usage of each keyword in a loop context.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Repetition Structure

Assignment 03

GADSE23.3-008
Diploma in Software Engineering
1. Prepare one page document to explain the difference between break keyword and
continue keyword. Explain with two suitable example codes

Break Keyword Continue Keyword

 Exits the current loop  Skip the current iteration

 Terminates the loop prematurely  Immediately moves the next


and continues with the next iteration of the loop.
statement after the loop

 Affect the entire loop  Affects only the current iteration


of the loop

 When a specific condition is met  When you want to skip the current
and you want to exit the loop iteration of the loop based on
certain condition and continue
with the next iteration

 Break statements uses switch and  It does not use switch and label
label statement statement

 Example  Example

int main() int main()


{ {
int i=0; int i=0;
while(i<10); while(i<10);
{ {
if (i==4) if (i==4)
{ {
Break; Continue;
} }
printf(“%d\n” ,i); printf(“%d\n” ,i);
i++; i++;
} }

return=0; return=0;
} }

PAGE 1
PAGE 2

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy