?
There is one small error in the following flip routine. Find out which line it is on.
There is one small error in the following flip routine. Find out which line it is on.
1 void flip(int arr[], int i)
2 {
3 int t, init = 0;
4 while (init < i)
5 {
6 t = arr[init];
7 arr[i] = arr[init] ;
8 arr[i] = t;
9 init++;
10 i--;
11 }
12 }
1 void flip(int arr[], int i)
2 {
3 int t, init = 0;
4 while (init < i)
5 {
6 t = arr[init];
7 arr[i] = arr[init] ;
8 arr[i] = t;
9 init++;
10 i--;
11 }
12 }
Join the Discussion
Login to post a comment or share your explanation.
Login