Click here to Skip to main content
15,886,873 members
Please Sign up or sign in to vote.
1.50/5 (2 votes)
See more:
the previous version of consecutive triangles is done and if any help on figures in four directions like rhombus in proper order.
Posted
Comments
BobJanova 25-Sep-12 6:09am    
homework

Here are some samples for C - you may easily port them to .NET:
http://www.interviewmantra.net/2009/10/10-star-pattern-programs.html[^]
 
Share this answer
 
 
Share this answer
 
hiii,

i think this one will help you

C#
class Program
    {
        static void Main(string[] args)
        {
            int i, j, k, n;

            Console.Write("Enter the No. :");
            n = int.Parse(Console.ReadLine());

            for (i = 1; i <= n + (n - 1); i++)
            {
                for (j = 1; j <= n + (n - 1); j++)
                {
                    if (i + j == (n + 1) || i + j == (n + n + n - 1) || i - j == (n -
            1) || i - j == -(n - 1))
                        Console.Write("*");
                    else
                        Console.Write(" ");
                }
                Console.WriteLine("\n");
            }
            Console.Read();
        }
    }
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900