Answered by : obnoxious-ocelot-v76c3xccs1pn
do { //something you want to execute at least once
} while (someBooleanCondition);
Source : https://stackoverflow.com/questions/3003456/why-use-a-do-while-loop | Last Update : Tue, 17 Nov 20
Answered by : undercode
int count = 10;
while(count < 10) { System.out.println(count); count++;
}
//while will run when if the condition is true
//if count is less then 10 the condition is true
//if count is more then 10 or equals to 10 it is false.
Source : | Last Update : Tue, 02 Nov 21
Answered by : syed-nayeem-ridwan
// Starting on 0:
int i=0; // initialization
while(i<10){ // condition
System.out.println(i);
i++; // increment operation
}
// Starting on 1:
int i=1;
while(i<=10){
System.out.println(i);
i++;
}
Source : | Last Update : Thu, 10 Aug 23
Answered by : tender-turtle-j0fvh6d5khw3
while(i < 5) //while i < 5 stay in the loop
{ System.out.print(i); i++;
}
/* do someting change variable call methods etc...
*/
Source : | Last Update : Thu, 12 Mar 20
Answered by : ill-impala-fza8tct4qqr5
while(condition)
{ statement(s);
}
Source : https://beginnersbook.com/2017/08/cpp-while-loop/ | Last Update : Tue, 31 Mar 20
Answered by : cautious-crocodile-t68n1luzf3g6
do { // code block to be executed
}
while (condition);
Source : | Last Update : Thu, 04 Nov 21
Answered by : dan-z16rp0dshpkx
while(booleanCondition){
// run your code here
}// while
do while loops will run once no matter what, but while loops will only run
if the boolean condition is satisfied
Source : | Last Update : Mon, 25 Oct 21
Answered by : elated-elephant-fdro8twckfpr
int number = 1;
while(number < 10){ System.out.println(number); number += 1;
}
Source : https://moringaschool.instructure.com/courses/428/pages/weekend-object-oriented-java-custom-methods-for-objects?module_item_id=37578 | Last Update : Mon, 02 Aug 21
Answered by : rihab-alyasiri
while(condition) {
}
Source : | Last Update : Sun, 10 Apr 22
Answered by : panicky-panda-e8jodokd8sqi
int count = 1;while (count < 11) { System.out.println("The count is " + count); count++; // remember, this increases the value of count by 1}
Source : https://wecancodeit.github.io/java-slides/fundamentals/while-loops/index.html#/3 | Last Update : Fri, 20 Aug 21