0
Hello everyone! I write a code and now I don't know if is possible to make it right on my way.
https://code.sololearn.com/cnpbD6saPmF9/?ref=app Left wing of array is ok, but right wing is not ok, as I aspect.
7 Respuestas
+ 1
Martin I know it, I just don't know how to make else part of the code right so that it will print elements in ascending format. Obviously there is something wrong with for loop with k-control variable who doesn't have affect on else statement.
+ 1
The code is poorly formatted which makes it hard to read.
Try the following changes and see if it is what you intended.
Comment out Line 22 (//continue).
Change line 25 from
for(int k=n/2+i+1; k<n; k++){
To
for(int k=i+1; k<n; k++){
Change line 34 from
while(i>n/2);
To
while(i<n);
+ 1
I get it finally.
0
In the second for loop , check the value of k again
0
How to check with one more for loop or if condition