Skip to content

Instantly share code, notes, and snippets.

@mallibone
Created February 4, 2017 11:58
Show Gist options
  • Save mallibone/6d5dfe1f888aa08e75dd937db5ce4ce0 to your computer and use it in GitHub Desktop.
Save mallibone/6d5dfe1f888aa08e75dd937db5ce4ce0 to your computer and use it in GitHub Desktop.
using System;
namespace ConsoleApplication
{
public class Program
{
public static void Main(string[] args)
{
while (new Random().Next(0, 50) > 50)
{
Console.WriteLine("While... Random seems to be bellow 50.");
}
do
{
Console.WriteLine("Do While... Random seems to be bellow 50.");
}
while (new Random().Next(0, 50) > 50);
for (int i = 0; i < 10; i++)
{
Console.WriteLine($"Current index is {i}");
}
var items = new[] { "Donna", "Harvey", "Rahel", "Mike" };
foreach (var item in items)
{
Console.WriteLine($"Hello {item}");
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment