Why am i not getting an output for the sample input

@Anchal hey anchal in line 23 there is small mistake if(i==n&&j==n) should be like if(i==n)