Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Random number between 1 - 100 between each value of 10 there will be a differnt message
//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 rdm = new Random(); int rand = rdm.Next(1,100); Console.WriteLine("This is a random number between 1 - 100"); Console.WriteLine("Inbetween each value of 10 there will be a differnt message"); Console.WriteLine("The number is:.." + rand); if (rand <= 10) { Console.WriteLine("Its is between 1 - 10"); Console.ReadLine(); } else if (rand <= 20) { Console.WriteLine("Its is between 11 - 20"); Console.ReadLine(); } else if (rand <= 30) { Console.WriteLine("Its is between 20 - 30"); Console.ReadLine(); } else if (rand <= 40) { Console.WriteLine("Its is between 31 - 40"); Console.ReadLine(); } else if (rand <= 50) { Console.WriteLine("Its is between 41 - 50"); Console.ReadLine(); } else if (rand <= 60) { Console.WriteLine("Its is between 51 - 60"); Console.ReadLine(); } else if (rand <= 70) { Console.WriteLine("Its is between 61 -70"); Console.ReadLine(); } else if (rand <= 80) { Console.WriteLine("Its is between 71 - 80"); Console.ReadLine(); } else if (rand <= 90) { Console.WriteLine("Its is between 81 - 90"); Console.ReadLine(); } else if (rand <= 100) { Console.WriteLine("Its is between 91 - 100"); Console.ReadLine(); } } } }
run
|
edit
|
history
|
help
0
CommandForce3
Gjrkfo
OOP vs DOD 2
functional program
Math 9.3
game 1.0.3
852
WithoutPortNo
Fórum ➡ Using Regex to insert "item" tags into the unique "list" tag of an XML data ♦
Exception-Nikhil