98.2k views
2 votes
Write a while loop that prints the first 16 numbers of the pattern: 1, 4, 9, 16, 25

User Satevis
by
6.9k points

1 Answer

3 votes

Answer:

Step-by-step explanation:

the pattern is increasing squared number. 1^2, 2^2, 3^2, 4^2, 5^2



int i=1;

while (i<=16) {

Print i^2;

i++;

}

User Suvayu
by
7.6k points