public class ForLoop { public static void main(String args[]){ int x; for(x = 0; x < 10; ++x) System.out.println(x); // find a given power of a number // x raised to power y = x*x*x... y times. x = 7; int y = 4; int i, result; // note that two ints are declared in one statement. result = 1; for(i = 0, result = 1; i < y; i++, result *= x); System.out.println(result); // local loop variable for(int z = 0; z < 10; z++){ System.out.println(z); } //System.out.println(z); } }