Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Random number generator with IF
//Title of this code //Rextester.Program.Main is the entry point for your code. Don't change it. using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; namespace Rextester { public class Program { public static void Main(string[] args) { Random rnd = new Random(); int Value = rnd.Next(1, 10); Console.WriteLine("This is a random number between 1 to 10.."); Console.WriteLine(Value); Console.WriteLine("This is the random number multiplied by itself"); Console.WriteLine(Value * Value); if (Value < 5) { Console.WriteLine("This is less that 5"); Console.ReadLine(); } if (Value == 5) { Console.WriteLine("This number is half way"); Console.ReadLine(); } if (Value > 5) { Console.WriteLine("This is more than 5"); Console.ReadLine(); } } } }
run
|
edit
|
history
|
help
0
Dotnetq5
nn
quick sort final
Reverse String in for loop
IsDivisibleV2
1
asxsdsdxasd
linq jean by Fausto
gfrsdfdfvgh
Expression Tree