jpnv8
03-29-2008, 04:10 AM
import java.io.*;
public class For
{
public static void main (String [] args)
{
int x;
for(x=0;x<3;x++) {
System.out.println(x);
/*
----------------------------------------------------
the SEQUENCE the computer reads the FOR statement
----------------------------------------------------
1.x=0
2.x<3
3.System.out.println(x);
4.x++
5.x<3
6.System.out.println(x);
7.x++
8.x<3
9.System.out.println(x);
10.x++
11.x<3
12.EXIT
-------
OUTPUT
-------
0
1
2
*/
}
}
}
A.)
I know how a single for statement works (see above) a help for those who doesnt know single FOR statement for newbies like me
Now Im confused in how three nested FOR statement works. Can you please show me the sequence of a 3 nested IF statement.
int x,y,z;
for(x=0;x<2;x++) {
System.out.println(x+ "A");
for(y=0;y<2;y++) {
System.out.println(y+ "B");
for(y=0;y<2;y++) {
System.out.println(y+ "C");
}
}
}
hey thx in advance.
public class For
{
public static void main (String [] args)
{
int x;
for(x=0;x<3;x++) {
System.out.println(x);
/*
----------------------------------------------------
the SEQUENCE the computer reads the FOR statement
----------------------------------------------------
1.x=0
2.x<3
3.System.out.println(x);
4.x++
5.x<3
6.System.out.println(x);
7.x++
8.x<3
9.System.out.println(x);
10.x++
11.x<3
12.EXIT
-------
OUTPUT
-------
0
1
2
*/
}
}
}
A.)
I know how a single for statement works (see above) a help for those who doesnt know single FOR statement for newbies like me
Now Im confused in how three nested FOR statement works. Can you please show me the sequence of a 3 nested IF statement.
int x,y,z;
for(x=0;x<2;x++) {
System.out.println(x+ "A");
for(y=0;y<2;y++) {
System.out.println(y+ "B");
for(y=0;y<2;y++) {
System.out.println(y+ "C");
}
}
}
hey thx in advance.