xxxxxxxxxx
while (operateur !== "+" || operateur !== "/" || operateur !== "-" || operateur !== "*"){
xxxxxxxxxx
h=0
m=7
while a<7:
for m in range(7):
h+=1
m-=1
print(a,b)
if m==1 or h==1:
break
xxxxxxxxxx
While(condition is true) {
// Code // The block keeps executing as long as the condition is true
// Code
}
xxxxxxxxxx
# simple while loop python.
input output
a=1 1
while a<=10: 4
print(a) 7
a=a+3 10
# here a=a+3 can be written as 'a+=3'
xxxxxxxxxx
#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")
xxxxxxxxxx
Create a loop that runs as long as i is less than 10.
var i = 0;
while(i < 10) {
console.log(i); i++
}
xxxxxxxxxx
let dice = Math.trunc(Math.random() * 6) + 1;
while (dice !== 6) {
console.log(`You rolled a ${dice}`);
dice = Math.trunc(Math.random() * 6) + 1;
if (dice === 6) {
console.log(`loop is ended`);
}
}
xxxxxxxxxx
$i = 1;
while ( $i < 40 ) {
echo "I am " . $i . " years old" . "\n";
$i ++;
}
xxxxxxxxxx
while(<condition here>)
{
do this;
increment or decrement;
}
//number variable must be initilize before run the program
/*
while (number <= 10)
{
print(number);
number++;
}
*/