Check out example codes for "while c#". It will help you in understanding the concepts better.

Code Example 1

int n = 0;
while (n < 5)
{
    Console.WriteLine(n);
    n++;
}

Code Example 2

int i = 0;

while (i < 10)
{
    Console.WriteLine("Value of i: {0}", i);

    i++;
}

Code Example 3

int repeats = 0; 
bool while = true; //creates a bool variable with the true value
while (while = true) //repeats the code in the curly brackets as long
{                    //as the value in the round brackets remains true
   repeats++; //increase the value inside repeats
}

Learn ReactJs, React Native from akashmittal.com