koding C# Membuat demensi segitiga
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
int n, i, j;
for (i = 1; i <= n; i++)
{
for (j = 1; j <= i; j++)
{ Console.Write("" + j); }
Console.WriteLine();
}
for (i = n; i >= 1; i--)
{
for
(j = 1; j <= i; j++)
{ Console.Write("" + j); }
Console.WriteLine();
}
Console.ReadLine();
}
}
}
0 komentar: