- 3
Give me a perfect example of do while loop in real life sinario
Give me a perfect example of do while loop in real life sinario
5 Respuestas
+ 16
do
{
wash_hands();
}
while (hands_are_dirty());
do
{
eat();
}
while (still_hungry());
do
{
brush_teeth();
}
while (cabbage_still_stuck_in_between_teeth());
+ 14
do
{
not_ask();
} while(question=Stupid);
--jokin bruh!
+ 5
fn main() {
let mut alive = true;
loop {
breathe();
if dead() {
let mut alive = false;
}
}
}
fn breathe() {
let mut alive = true;
}
+ 3
I normally use that if I would like ask the user if he/she wishes to continue or exit the program
do
{
.
.
.
cout << "Do you wish to continue?";
cin >> response;
}while(*your condition*)
0