0
Loops
How do i create a loop to print out the following sequence; 1) 1, 4, 9, 16, 25, 36, 49, 64, 81, 100 In JAVA
3 Réponses
+ 5
It is pretty easy, something like this will do it:
public class Program {
public static void main(String[] args) {
for(int x=1; x<=10; x=x+1) {
System.out.println(x*x);
}
}
}
+ 1
Thanks guys soo much🙏