Computer Science, asked by 52331, 10 months ago

java program to find the sum of the first ten natural numbers​ using while loop

Answers

Answered by akashhes261004
6

Explanation:

importjava.util.*;

class sum

{

public static void main()

{

int i ,s=0;

for(i=1;i<=10;i++)

{

s=s+i;

}

S.o.p.ln("sum is "+s);

}

}

Similar questions