I have a doubt with geeks and geeks problem?

https://practice.geeksforgeeks.org/problems/cpp-loops-set-1-print-a-string-n-times/0

i want to solve the above problem and i have written the code (which i am sharing the link) but it shows error everytime. how to solve this problem? what is the error with my code. please help me to solve this.

@Anku47 corrected

what is the purpose of line no. 15???
n–;

@Anku47 in loop there is while(n>0) so we have to decrease n after every case

1 Like

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.