+ 21

use of do while loop with a real life example

12th Mar 2017, 6:45 PM
Prudhvi Raaj
Prudhvi Raaj - avatar
4 Respostas
+ 24
do while loop is used when u what that the loop executes at least 1 time and then checks the conditions and executes itself till the condition becomes false like a new restaurant is open in your area now u want to know is the food of that restaurant is accord to ur taste or not so u can visit there frequently but for that u had to go in restaurant at least one time and if ur conditions satisfied then u will visit the restaurant frequently just like that do while loop works
12th Mar 2017, 7:14 PM
Mansi Dagla
Mansi Dagla - avatar
+ 5
php $to_pee = true; do{ $to_pee=false }while($to_pee)
12th Mar 2017, 6:52 PM
Ihor
+ 2
Using Facebook as an example. Click to view your friends list. Everybody has a variable number of friends, so you need code to iterate over each friend to display their photo, name, and profile link. foreach(var $friend in $user->friends) { show_friend($friend); }
12th Mar 2017, 7:13 PM
Simen Daehlin
Simen Daehlin - avatar
+ 1
$displaywarning=true do{ echo "warning" echo "do you want to see this warning again?" }while($displaywarning=false) [when you uncheck it to not seeing it more]
5th Apr 2017, 6:11 AM
jestada007
jestada007 - avatar