Advertisement
KodingKid

Most basic script in C# for representing random probability (50-50 guessing question)

Jun 12th, 2021
218
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.48 KB | None | 0 0
  1. Console.WriteLine("Enter a number between 0 and 10")
  2. int randprob = 5;
  3. inp = Console.ReadLine();
  4. if (inp > randprob) {
  5.     Console.WriteLine("You are in the top 50% of guessers");
  6.     break;
  7.     }
  8. if (inp < randprob) {
  9.     Console.WriteLine("You are in the bottom 50% of guessers");
  10.     break;
  11.     }
  12. if (inp > 10) {
  13.     Console.WriteLine("Enter a number between 0 and 10");
  14.     break;
  15. }
  16. if (inp < 0) {
  17.     Console.WriteLine("Enter a number between 0 and 10");
  18.     break;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement