Skip to content
Menu
Code for Java c
  • Home
  • Java
    • Java Examples
    • Java tutorials
  • C
    • C tutorials
    • C Examples
  • C++
    • C++ Tutorials
    • C++ Examples
  • Python
    • Python Tutorials
    • Python Examples
  • About
    • About me
    • contact us
    • disclaimer
    • Privacy Policy
Code for Java c

while loop with continue break and pass

Posted on October 6, 2017January 24, 2020

Table of Contents

  • while loop with continue, break and pass
      • While loop with the pass statement
      • While with continue statement
      • While  with the break statement
      •   The break statement in python is used to terminate the execution of the current loop.
      •   Program 1

while loop with continue, break and pass

In this tutorial, we will discuss the concept of while loop with continue, break and pass.

While loop aids with repeating tasks in an efficient manner.
In python, pass, continue and break statements can be used in while loops.

While loop with the pass statement

We can use the pass statement to write empty loops. Pass is also used to empty control loops, function and classes. The pass statements is a null operation, nothing happens while it executes.

Program 1

When the above code is executed, it produces the following results
Display error massage
Program 2

When the above code is executed, it produces the following results

No error massage and no output

Program 3

When the above code is executed, it produces the following results

0
1
2
3
4
5

program 3

When the above code is executed, it produces the following results

var is==3

While with continue statement

The continue statement is used in a loop to take the control to the top of the loop without executing the rest of the statements inside the loop.

"while

program 1

When the above code is executed, it produces the following results
error
program 2

When the above code is executed, it produces the following results

No error and no output

Program 3

When the above code is executed, it produces the following results

1 2 4 5 6 7 8

While  with the break statement

  The break statement in python is used to terminate the execution of the current loop.

"while

  Program 1

When the above code is executed, it produces the following results.
error
Program 2

When the above code is executed, it produces the following results

No error and no output

Program 3


When the above code is executed, it produces the following results

1 2 3

 

Similar post

for loop with pass break continue statements

Pass statement in Python

continue statement in puthon

break statements in Python

Continue statements in C language

break statements in C language

Related

Recent Posts

  • Subtract two numbers using method overriding
  • PHP Star triangle Pattern program
  • Using function or method to Write temperature conversion : Fahrenheit into Celsius
  • Function or method:temperature conversion from Fahrenheit into Celsius – Entered by user
  • Write temperature conversion program: Fahrenheit into Celsius
  • How to write a program to convert Fahrenheit into Celsius

tag

Addition (6) Array (38) C++ language (91) C language (98) c sharp (23) Division (6) Function (29) if else (32) Java language (102) JavaScript (5) loops (137) Multiply (7) Oop (2) patterns (65) PHP (13) Python Language (38) Subtraction (7) temperature (20)

Archives

Categories

Address

Global information technology

Puloly south, PointPedro

Jaffna

Srilanka

©2025 Code for Java c | Powered by SuperbThemes