Computer Science, asked by sjaitely, 6 months ago

Rewrite the following code using while loop.

final int N = 15;
for(int i=0, sum =0; i sum += i;
System.out.println("Sum = "+sum);

Answers

Answered by Pelin
5

Answer:

final int N=15;

int i=0;

int sum=0;

Sum+=i;

while (sum<=N)

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

i++;

Similar questions