C# Programming

Loops

C# Programming / Loops

Loops

C# Loops

A loop statement allows us to execute a statement or a group of statements multiple times and following is the general from of a loop statement in most of the programming languages −

Loop Architecture

Example

In the following example, we define an array and use the loop to display the elements of the array −

using System;

class Example {

  static void Main(string[] args) {

   int[] number = { 1, 2, 3, 5, 6 };   

   for (int i = 0; i < number.Length; i++) {

   Console.WriteLine(number[i]);   

 }   

}

}

Technology
C# Programming
want to connect with us ?
Contact Us