FOR LOOP IN C#

Ankit Singh

Total Post:341

Points:2389
Posted by  Ankit Singh
C#  .NET  Loop 
C#
 454  View(s)
Ratings:
Rate this:
 I want to use for loop in c# Please help me.
  1. aditya kumar Patel

    Post:254

    Points:1810
    Re: for loop In c#

    The for loop is a bit different. It's preferred when you know how many iterations you want, either because you know the exact amount of iterations, or because you have a variable containing the amount.

    using System;

    namespace ForLoop

    {

    class Program

    {

    static void Main(string[] args)

    {

    int number = 10;

    for (int i = 0; i < number; i++)

    Console.WriteLine(i);

    Console.ReadLine();

    }

    }

    }

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!