please check the code why the spacing and numbers are not printing correct order as per question.Where iam going wrong
Pattern Mountain question
Hey Buddy!
The logic that you’ve applied does not generalise well. I have commented the hint at the end of your code, please check it.
please tell where iam doing wrong not the code.Please explain what is wrong with my code.
clearly the loops that you have applied are not correct. They may work for one or two cases, but are not giving the right answer in any other cases
Yaa. where i am doing wrong.Please give an example and explain clearly:sweat:
while(m<=spcCount){ //This loop is not running fine, its printing less spaces than it should
cout<<" “;
m++;
}
for(j=i;j>0;j–){
cout<<j<<” ";
}
Why?please explain the reason.
because in the question, you have to print (2*(n-i))-1) spaces and tabs for every row i, where i starts from 1, and your loop is making less iterations than that