jloga4
5/30/2017 - 7:54 PM

Example using while statement.

Example using while statement.

int num = 1;

while (num <= 10)
{
  Console.WriteLine("The current value of num is: " + num);
  num++;
}

//	The current value of num is: 1
//	The current value of num is: 2
//	The current value of num is: 3
//	The current value of num is: 4
//	The current value of num is: 5
//	The current value of num is: 6
//	The current value of num is: 7
//	The current value of num is: 8
//	The current value of num is: 9
//	The current value of num is: 10