2
Contributors
7
Replies
8
Views
5 Years
Discussion Span
Last Post by Begginnerdev
0

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?

0

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

Edited by yunis.nabil

0

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?

0

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

0

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."

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.