What is wrong in the code written

for (int i = 1; i <= a; ++i) {
if (i > 1)
System.out.println(); // more than 1 line, need delimiter (new line)

 for (int j = 1; j <= i; ++j) {
   if (j > 1) 
     System.out.print(" "); // more than 1 column, need delimiter (space)

   System.out.print(j);
 }   

}

@kasturichakraborty36_24075fa79f00d4e8 Always send your full Code. Here What are you trying to do You have asked the ganesha pattern but your code is clearly not related to ganesha pattern which question are you trying to do?

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.