/Program.cs Secret
Created
November 17, 2020 16:30
Star
You must be signed in to star a gist
Codecademy export
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
namespace Review | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
//Number Guessing game from 1 -10 | |
var rand = new Random(); | |
int guess = rand.Next(1, 10); | |
Console.WriteLine("Guess number betweem 1-10: "); | |
double userNumber = Convert.ToDouble(Console.ReadLine()); | |
if(userNumber == guess){ | |
Console.WriteLine("You guessed correctly"); | |
} else if(userNumber > guess){ | |
Console.WriteLine("You guessed higher number"); | |
} else if(userNumber < guess){ | |
Console.WriteLine("You guessed lower number"); | |
} else{ | |
Console.WriteLine("Guess Again"); | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment