I am getting wrong output

from using row-1 i am getting the first row as 0
the output i want is
1
11
202
3003
40004
but the output i am getting is
0
11
202
3003
40004
maybe the change is to be done in iterative statement but i am not getting the logic.

Please share your code through the online IDE from the next time onwards.(https://ide.codingblocks.com)

You need to handle the case of 1st row explicitly inside your else block.ie.

else{
if(row==1){
System.out.print(row);
}else{
System.out.print(row-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.