Convert the following into a do while loop The following cod

Convert the following into a do while loop.

The following code calculates the sum of array elements. Convert this code to a do-while loop (C code only): int row sum; int array sum = 0; for (int i = 0; i

Solution

int row_sum;
   int array_sum=0;

int i=0,j;
do
{
j=0;
do
{   row_sum =row_sum+ a[i][j];
j++;
}while(j <=9);
array_sum = array_sum + row_sum;
row_sum=0;
i++;
}while(i <= 9);

Convert the following into a do while loop. The following code calculates the sum of array elements. Convert this code to a do-while loop (C code only): int row

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site