I want to print mountain pattern and i am facing issue that how to write one 4 instead of two 4 in that pattern
About the challenge
plz send me the link of code
add this condition in your code
if(!(row==n&&cnt==1))cout<<val;
Modified code
can u explain me how this condition is working?
okay
we check if row==n means we are at last row
now if cnt==1 means we are printing 4 second time
if these both condition holds then do not print value
or we can say that
print only if both these condition fails
means not of(row==n and cnt==1)
so i write
if(!(row==n&&cnt==1)
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.