Nestedloops Worksheet1 Java Aplus
Nestedloops Worksheet1 Java Aplus
DIRECTIONS : Fill in each blank with the correct answer/output. Assume each
statement happens in order and that one statement may affect the next
statement.
Some sections might print more than once.
int total = 0;
for(int c=2; c<7; c++)
for(int d=1; d<=c; d++)
total = total + d; 3. _________________________________
out.println(total);
String s = "apluscs";
for(int e=0; e<s.length(); e++)
{
for(int f=0;f<=e;f++){
System.out.print(s.charAt(f));
}
System.out.println(); 4. _________________________________
}
int size=4;
for(int x=0; x<=size; x++ )
{
for(int y=x; y<=size; y++ )
out.print(" ");