+ 1

No Output.

I want to print the following pattern. 33333 32223 32123 32223 33333. But having no output. What's wrong? https://code.sololearn.com/cp8hfUhRMJBR/?ref=app https://code.sololearn.com/cp8hfUhRMJBR/?ref=app

15th Feb 2020, 8:06 AM
Syed Waseem
Syed Waseem - avatar
7 Respostas
+ 1
Salam, hi Timeout: the monitored command dumped core. for(k=0;k<=2*(c++);k++) in line 43, you can't use increment in loop condition that will cause infinity loop k will never rich the value of 2*(c++), replace (c++) with (c+1).
16th Feb 2020, 11:18 PM
Rafik Abdelhak Nadir
Rafik Abdelhak Nadir - avatar
+ 3
Also for(j=n-1;j>=0;j++) in line 35 results in an infinite loop. If you count up j it will obviously be larger than 0.
15th Feb 2020, 8:44 AM
Aaron Eberhardt
Aaron Eberhardt - avatar
+ 2
Don't --i in for loop of i (line 28, line 44)
15th Feb 2020, 8:33 AM
Gordon
Gordon - avatar
+ 2
Think you used one to many } Remove the one in line 50 and put it after line 60. Then you get the print but still wrong.
15th Feb 2020, 8:40 AM
Paul
Paul - avatar
+ 2
Look to the changes I've made, you might like it https://code.sololearn.com/cw3dr1bxeQuC/?ref=app
17th Feb 2020, 5:57 PM
Rafik Abdelhak Nadir
Rafik Abdelhak Nadir - avatar
+ 1
Rafik Abdelhak Nadir ,Aaron Eberhardt ,Gordon ,Paul Jacobs. JazakALLAHukhairrr, Thank You so much for taking the time and helping Me... Now it's sorted...
17th Feb 2020, 1:45 PM
Syed Waseem
Syed Waseem - avatar
0
Sayed Waseem. W jazaka allaho bimethlih. U r welcome.
17th Feb 2020, 4:43 PM
Rafik Abdelhak Nadir
Rafik Abdelhak Nadir - avatar