@Kamaria
What you did in second loop and first loop
j=5 and
i=5..It shows you the error. Actually
j=5 is an assignment operation not a conditional operation. Actually the second statement in for loop must return true or false if the statement exists. But here the statement returns 5.
As Josh said make a method to do this task and call it from main. And take a variable which indicates the no. of rows instead of constant.
Now your first loop is OK if i make it
i<=5. But the logical error is in second loop.
See here as the no. of rows increase the column no. is increasing. In each row the column no. is same as row no. So the second loop must be as the current no. of row.
So think a little bit and make the program successful ;)