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