Manmohan loves patterns-1

no output received

Hello @aan,

There are following issues with your code:
1.
Your code is stuck in an infinite loop, which is causing no this error:

else{
while(d<0){
cout <<“1”;
}
}

There is no increment statement in the segment of code.

What is the initial value of d? Have you initialized it?
This is another reason for Infinite iterations

Even if you would correct the above two issues, your code would not print the desire results.
Reason:

if(n%2==0){}

Solution:

if(a%2==0){

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

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.