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
Math,
1 month ago
Biology,
1 month ago
Math,
1 month ago
Accountancy,
3 months ago
English,
3 months ago
Social Sciences,
9 months ago
Math,
9 months ago