Compilation error nothing getted printed

my code

bro first line meh kuch print he nhi hoga

	for(int i=0;i<n;i++)
	{
		for(int space=0;space<=n-i-2;space++)
		{
			cout<<" ";
		}
		for(int row=0;row<=i;row++)
		{

yeh loop meh andar jayega he nhi

it should had printed 1 in the 1th line after n-i-2 spaces

U got to check up the logic

nhi loop mein andar kyun nhi jayega? row ki initial value is 0 and condition for loop to execute <=0 so why will it not go inside the loop?

acha mam i got my error it wasnt about loop thing it was the error in the factorial function i created there was no specification what will it return if 0 in input and the very first time we enterd in for loop there we sent 0 to the function and program kept waiting for return.
Thanks Mam

1 Like

sorry
my bad.
thanks for correcting

Great happy to know u debugged it yourself

Still mam thanks for assistance

1 Like