Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Random number generator
//Microsoft (R) Visual C# Compiler version 3.4.0-beta4-19562-05 (ff930dec) //Copyright (C) Microsoft Corporation. All rights reserved. using System; using System.Collections.Generic; using System.Linq; namespace Rextester { public class Program { public static void Main(string[] args) { bool tryagain=true; int big; int small; Random r=new Random(); Console.WriteLine("Hello,this is a random number generator made by Matthew"); Console.WriteLine("\nWhat is the smallest number?\n"); int number1=Convert.ToInt32(Console.ReadLine()); Console.WriteLine("\nOk,what is the biggest number?\n"); int number2=Convert.ToInt32(Console.ReadLine()); if(number1>number2){big=number1; small=number2;} else{small=number1; big=number2; } Console.WriteLine(""); while(tryagain){ for(int a=0;a<3;a++){ Console.Write("."); System.Threading.Thread.Sleep(500);} Console.WriteLine("\n\nYour random number is "+r.Next(small,big+1)); Console.WriteLine("\nDo you want to generate it again?\n"); string b=Console.ReadLine(); if(b.ToLower()!="yes"){Console.WriteLine("\nThank you for trying my random number generator!"); tryagain=false; }else{Console.Write("\n");} }} }
run
|
edit
|
history
|
help
0
438935
test coeur
shut down
30272 Program Ex5 if_else2_odd_even
world
ruSrib
Chest Interaction Unity
Validate or get the check digit of a Windows activation installation ID / confirmation ID
HTML Hex to RGB without using System.Drawing C#
aszasxsdf