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
    • Related

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

  • Multiply two numbers in Java using scanner| 5 different ways
  • 5 different ways to Divide two numbers in Java using scanner
  • Learn 8 Ways to Subtract Two Numbers Using Methods in Java
  • 10 ways to subtract two numbers in Java
  • Java Code Examples – Multiply Two Numbers in 5 Easy Ways
  • How to Divide two numbers in Java| 5 different ways

tag

Addition (8) Array (38) C++ language (91) C language (98) c sharp (23) Division (8) Function (29) if else (32) Java language (108) JavaScript (5) loops (138) Multiply (8) Oop (2) patterns (66) PHP (13) Python Language (38) Subtraction (9) temperature (20)

Archives

Categories

Address

Global information technology

Puloly south, PointPedro

Jaffna

Srilanka

©2026 Code for Java c | Powered by SuperbThemes