a for loop to display 1 to 5

image_pdfimage_print

/*
Mastering Visual C# .NET
by Jason Price, Mike Gunderloy

Publisher: Sybex;
ISBN: 0782129110
*/

/*
Example4_11.cs illustrates the use of
a for loop to display 1 to 5
*/

public class Example4_11
{

public static void Main()
{

for (int counter = 1; counter <= 5; counter++) { System.Console.WriteLine("counter = " + counter); } } } [/csharp]