Challenging Numerical Triangles
by CodeChum Admin
You probably have encountered Triangle pattern problems before when you started learning programming. Let’s see how well you do with numbers this time. Try to look at the examples closely and think of an algorithm that replicates the outputs. Go for it!
using System;
using System.Text;
class Program
{
static void Main()
{
int n = 99;
for (int i = 0, j = 1; i < n; i += j, j++)
Console.WriteLine(new string('*', j));
}
}
Comments
Leave a comment