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

Program: Using Using Using Using Namespace Class Static Void String Int For For

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)
18 views1 page

Program: Using Using Using Using Namespace Class Static Void String Int For For

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
You are on page 1/ 1

using using using using

System; System.Collections.Generic; System.Linq; System.Text;

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++) { Console.Write(" "); } for (k = 1; k <= i; k++) { //if ((j + k) % 2 == 0) //{ Console.Write("* "); //} //else //{ // Console.Write("0 "); //} } Console.WriteLine(); } Console.Read(); } } }

You might also like