Respuesta :

The program that will print (SQUARE) of first 10 natural numbers using while  loop is given below.

What is the code that returns the above result?

The program that returns the above result is:

public class KboatNaturalNumbers

{

   public static void main(String args[]) {

       int n = 1;

       int sum = 0;

       while (n <= 10) {

           System.out.println(n);

           sum = sum + n;

           n = n + 1;

       }

       System.out.println("Sum = " + sum);

   }

}

What is a loop?

A loop is a set of instructions that are repeatedly carried out until a specific condition is met in computer programming.

In most cases, a given procedure, such as collecting data and changing it, is followed by a condition check, such as determining whether a counter has hit a predetermined number.

Learn more about loops:
https://brainly.com/question/26568485
#SPJ1

ACCESS MORE