public class Lab8_Ex1

{

public static void main(String [] args)

{

int sum = 0;

int n = 10;

compute_sum(n);

System.out.println(“The sum is “ + sum);

System.exit(0);

}

public static void compute_sum(int x)

{

int sum = 0;

int num = 1;

while (num <=x)

{

sum += num;

num++;

}

}

}

It's supposed to sum up the no. 1-10