write a program to view a pyramid structure of a input number. pyramid should look like this
if number is 5
then pyramid will be
1
1 2 1
1 2 3 2 1
1 2 3 4 3 2 1
1 2 3 4 5 4 3 2 1

Hi, I'm not sure that your meaning like this ..........

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace pyramid
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.Write("IN PUT YOUR NUMBER :");
            int myInt = int.Parse(Console.ReadLine());
            for (int iCount1 = 1; iCount1 <= myInt; iCount1++)
            {
                for (int iCount2 = 1; iCount2 <= iCount1; iCount2++)
                {
                    Console.Write(iCount2 + " ");
                }
                for (int iCount3=(iCount1-1);iCount3 >= 1; iCount3--)
                {
                    Console.Write(iCount3 + " ");
                }
                Console.WriteLine("");
            }
        }
    }
}
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.