how to make this shape in c#?
111111111
3333333
55555
777
9

Recommended Answers

All 7 Replies

By using nested for loops.

Something tells me you are asking for homework code...

Do you have any code where you have tried this on your own?

yes it is homework

i wrote this
for (int i = 1; i < 10; i=i-2)
            {
                for (int j = 9; j < 10; j = j - 2)

                {
                    Console.WriteLine(i);
                }

-------------------------------
buti think it is totally wrong
plz help:D

Think about it this way.

You need a total of 5 lines.
Each line's printed value is n+2 from last value.
Each line's length is decreased by 2 each iteration.

Have you learned to flowchart yet?

please do it i tried 6 times
write the code and give me
other example to solve it my self

Have you learend to flowchart yet?

If so, just lay the problem out in flowchart form..the answer will then be clear.

It will only be a syntax issue from there.

As for solving homework for you, we can't do that. You may get a good grade now, but you have not learned anything.

"Give a man a fish, he will eat for a day. Teach a man to fish, he will eat for a lifetime."

ok Iwill try

Do you have a flowcharting program?

If not, try raptor:

Click Here

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.