rewrite the following program using loop sum=0 i=1 while (i=<10): sum=sum+i i=i+1 print( "sum=" ,sum)
Answers
Answered by
7
Explanation:
int sum =0, i = 1;
while ( i <= 10 ) {
sum= sum + i ;
i = i + 1;
}
printf ("sum=%d",sum);
Similar questions
Physics,
2 months ago
Physics,
2 months ago
English,
2 months ago
Accountancy,
4 months ago
English,
4 months ago
Social Sciences,
11 months ago
Math,
11 months ago