while( <condition> ) { <loop body> }
do { <loop body> }while( <condition> );
How many times should I say hello? 5 hello HELLO hello HELLO hello
for(<initialization expression> ; <loop condition> ; <update expression>) { <loop body> }
i = 0
i < 10
i++
Just after
the update expression, the loop condition is evaluated, and maybe the loop continues or maybe it stops,
depending on the condition's truth or falsehood.
<initialization expression>; while(<loop condition>) { <loop body> <update expression>; }
This program outputs a shape. How wide do you want it? 4 How tall? 3 [][][][] [][][][] [][][][] [cpersiko@fog cs111a]$ java NestedBrackets This program outputs a shape. How wide do you want it? 2 How tall? 5 [][] [][] [][] [][] [][]