Output * with nested for loop - CSharp Language Basics

CSharp examples for Language Basics:for

Description

Output * with nested for loop

Demo Code

using System;//from  w  w  w. ja v a 2s . c  om
class StarsTwoDimensions
{
   public static void Main()
   {
      for (int i = 0; i < 5; i++)
      {
         for (int j = 0; j < 7; j++)
         {
            Console.Write("*");
         }
         Console.WriteLine();
      }
   }
}

Result


Related Tutorials