ms_learn_csharp/013_eval_boolean_expressions/challenge_excercise/Program.cs

8 lines
216 B
C#
Raw Permalink Normal View History

2024-07-19 20:30:50 -04:00
int num = new Random().Next(1,11);
Console.WriteLine($"{(num%2==0 ? "heads" : "tails")}");
Console.WriteLine("------");
Random coin = new Random();
Console.WriteLine((coin.Next(0, 2) == 0) ? "heads" : "tails");