You told me to fix the size. How to change because its been initialized. Mr crow told to increment later in the loop. But its should be there in the while part itself. If so how to rectify by changing the array size.
As long as you insist that you don't need any code modifications, you will get nowhere with changing the array dimensions.
You are computing and filling in array entries 1 through 5
You are printing out array entries 0 through 4
That is *bad code*, changing array dimensions will not affect this basic flaw.
David Crow has given you two excellent hints (nobody is going to write the program for you). I gave you hints on the fundamental problem. Now it is your turn to demonstrate that you have read, understood, and found the problem yourself. David and I have already passed this course.
You got that answer because your program is logically flawed because of the way you increment the counter i in the first loop as you've been repeatedly told. Unless you change that, you'll never get the right answer. Most people use for loops in instances like yours.
You measure democracy by the freedom it gives its dissidents, not the freedom it gives its assimilated conformists.
Your while() loops are backwards. Think about drawing this figure on paper. You start with the first column of the first row, then the second column of the first row, etc. After the last column, you go to the next row (i.e., first column of the second row).
You've not changed the inner printf() statement to use a width specifier. Did you not read the link I offered? It should look like:
printf("| %2d", number);
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons