Answers for "define while loops."

2

while loop

While(condition is true) {

// Code                                         // The block keeps executing as long as the condition is true

// Code

}
Posted by: Guest on August-21-2021
4

while loop

#input                                    # output
a=6                                        quantity of commodity=   
b=int(input("quantity of commodity="))     sampoo 
i=1                                        sampoo
while i <= b :                             sampoo
    if i>a:                                sampoo
        print("hello")                     sampoo
        break                              sampoo
    print('sampoo')                        hello  (it is printed when a<=7) 
    i+=1                                   thank you for coming
print("thank you for coming")
Posted by: Guest on November-20-2021
0

While Loop

A while loop statement in Java programming language repeatedly executes a target statement as long as a given condition is true. 

Syntax : 
while(Boolean_expression) {
   // Statements
}
Posted by: Guest on August-31-2021

Python Answers by Framework

Browse Popular Code Answers by Language