Pattern DoubleSidedArrow


last line is printing wrong.please help

Hello @srshubhi398,

  1. Use the same if(i>1) condition that you have use in the logic of upper half.
    This will eliminate the extra 1 of the last line.

  2. There is one more issue of inner spaces of the lower half in your code.
    Try to execute your code for 9
    Solution:
    csp = n/2+1;

I have modified your code:

Hope, this would help.
Give a like if you are satisfied.

1 Like

thankyou for this help.

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.