Arrays- wave print column wise

My code gives correct output in offline ide but when i submit it , it shows so many zeros in between the output.
please tell where i am going wrong.

link doesn’t contain code
Please check and give correct code link

give some size to array
Modified code

i hope this help
if you have more doubts regarding this feel free to ask
if your doubt is resolved mark it as resolved from your doubt section inside your course

i hope this help

if you have more doubts regarding this feel free to ask

if your doubt is resolved mark it as resolved from your doubt section inside your course