hhmm.. i need to get the pattern of this particular output on one digit odd number.. could anyone please teach me? ^^

if the number is 9:

then the pattern is:

*000*000*
0*00*00*0
00*0*0*00
000***000

yeah, the three asterisks get nearer as the line gets down...
how can i formulate the formula needed for the loop?

this is what i made so far..

for(x=1;x<=4;x++)
printf("*");
for(y=1;y<=(num-3);y++)
{
printf("0");
}
printf("\n");

## All 4 Replies

This is how we can sum up the whole Pattern ...

See that the 1st line starts up with the first and last space filled with a '*' And Then in the second line.there is an increment at the left side by one, and on the other side you have the decrement.

The Last thing that you must observe is that the Middle Elements Remain in the same and they dont get affected through out the program.

So for any value 'n' entered as the input.
You will see that you have to print a grid with n rows and n columns.
and that the 1st ,n/2th and nth place in the first line have to be filled with the "*".
And then the progression goes down.

Hope this has been helpful to you .

A supposedly different thread in disguise.

For the OP - stop wasting everyone's time by creating a new thread when you haven't even bothered with the pending conclusion of your most recently related thread:

yellowSnow.. it's not a disguise, i really intended to create new thread because my question in my former thread was already answered though there's a hanging question in there. and this thread? is for the pattern i need to thoroughly understand because my professor told me i got it wrong. just the pattern i need to be sure of. IF YOU DON'T WANNA HELP or WASTE YOUR TIME for this thread, why even bother to follow. sorry for not being a geek like you. :) and oh wait thank you oh dear for posting my former thread, if there are some people who'll visit that, thanks to them.

This is how we can sum up the whole Pattern ...

See that the 1st line starts up with the first and last space filled with a '*' And Then in the second line.there is an increment at the left side by one, and on the other side you have the decrement.

The Last thing that you must observe is that the Middle Elements Remain in the same and they dont get affected through out the program.

So for any value 'n' entered as the input.
You will see that you have to print a grid with n rows and n columns.
and that the 1st ,n/2th and nth place in the first line have to be filled with the "*".
And then the progression goes down.

Hope this has been helpful to you .

~ sure thing. thanks for having Sky Diploma here. :) :) :) :icon_cheesygrin:

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.