Algorithms Pascal Triangle suggest change

Implementation of Pascals Triangle in C

public class PascalsTriangle
{
    static void PascalTriangle(int n)
    {
        for (int line = 1; line <= n; line++)
        {
            int c = 1;
            for (int i = 1; i <= line; i++)
            {
                Console.WriteLine(c);
                c = c * (line - i) / i;
            }
            Console.WriteLine("\n");
        }
    }

    public static int Main(int input)
    {
        PascalTriangle(input);
        return input;
    }
}

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents