i`ve written the code but its only displaying 1,2,3,4,5
help me please
here is the source code:
public class Loopy {
public static void main(String[] args) {
int x = 1, sqt;
sqt = (x)^2;
System.out.println("Display Numbers from 1 to 5");
while (x <= 5) {
System.out.println("In the Loop");
System.out.println("Value of x is " + x);
x = x + 1;
}
System.out.println("This is after the loop");
}
}

New Topic/Question
Reply




MultiQuote






|