0% found this document useful (0 votes)
9 views1 page

C# Star Pattern Console Application

The document contains code for a nested for loop that prints out a triangular pattern of asterisks. The outer for loop iterates 5 times, controlling the number of rows. The inner for loops handle printing the spaces and asterisks, with the number of asterisks increasing by one each row as i is incremented from 1 to 5.

Uploaded by

virilebuddy
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views1 page

C# Star Pattern Console Application

The document contains code for a nested for loop that prints out a triangular pattern of asterisks. The outer for loop iterates 5 times, controlling the number of rows. The inner for loops handle printing the spaces and asterisks, with the number of asterisks increasing by one each row as i is incremented from 1 to 5.

Uploaded by

virilebuddy
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

using using using using

System; [Link]; [Link]; [Link];

namespace ConsoleApplication15 { class Program { static void Main(string[] args) { int i, j, k; for (i = 1; i <= 5; i++) { for (j = i; j <= 4; j++) { [Link](" "); } for (k = 1; k <= i; k++) { //if ((j + k) % 2 == 0) //{ [Link]("* "); //} //else //{ // [Link]("0 "); //} } [Link](); } [Link](); } } }

You might also like