Provides both the output of the following code as well as th

Provides both the output of the following code, as well as the contents of the array a when prompted

Solution

1) Result after each iteration :

i   O/P   a[i-1]  
9   10   a[8]=9
8   9 a[7]=8
7   8 a[6]=7
6   7 a[5]=6
5   6 a[4]=5
4   5 a[3]=4
3   4 a[2]=3
2   3 a[1]=2
1   2 a[0]=1

Final Program Result:

Program Output : 10 9 8 7 6 5 4 3 2

Content of array int a[9] : {1,2,3,4,5,6,7,8,9}

2) Result after each iteration :

i   O/P   a[i]
4   5   a[4]=12
5   6   a[5]=15
6   7   a[6]=18
7   8   a[7]=21

Final Program Result:

Program Output :

5

6

7

8

Content of array int a[8] : {1,2,3,4,12,15,18,21,9}

 Provides both the output of the following code, as well as the contents of the array a when prompted Solution1) Result after each iteration : i O/P a[i-1] 9 10

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site