Computer Science, asked by thilak9, 9 months ago

write a program in Java to display the sum of first 10 numbers using
(a) for loop (b) while loop (c) do-while loop​

Answers

Answered by mdaymaan9
2

Answer:

for(int I=0:I<=10;I++)

sum+=I;

int k =0;

while(++k<=10)

sum+=k;

int j=1;

do

{

sum+=j;

j++;

}

while (j<=10);

Hope this helps

please follow me and mark me brainliest

Similar questions