skipter icon

C# Fundamentals - Traingle of Numbers

skipter | PRO | 06/03/17 06:27:31 AM UTC | 0 ⭐ | 326 👁️ | Never ⏰ | []
C# |

540 B

|

None

|

0 👍

/

0 👎

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApp9
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
 
            for (int row = 1; row <= n; row++)
            {
                for (int col = 1; col <= row - 1; col++)
                {
                    Console.Write(row + " ");
                }
                Console.WriteLine(row);
            }
        }
    }
}

Comments