Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Random rand = new Random();
- int minA;
- int maxA;
- int minB;
- int maxB;
- int usersAnswer;
- Console.WriteLine("what is the minimum value: ");
- Int32.TryParse(Console.WriteLine(), out minA);
- Console.WriteLine("what is the minimum value: ");
- Int32.TryParse(Console.WriteLine(), out maxA);
- Console.WriteLine("what is the minimum value: ");
- Int32.TryParse(Console.WriteLine(), out minB);
- Console.WriteLine("what is the minimum value: ");
- Int32.TryParse(Console.WriteLine(), out maxB);
- Console.WriteLine("What is the result of {0} % {1}? ", rand.Next(minA, maxA), rand.Next(minB, maxB));
- Int32.TryParse(Console.ReadLine(), out usersAnswer);
- answer = //directly implementing the random numbers generated with modulous operator)
- if(userAnswer == answer)
- {
- Console.WriteLine("{0} is correct", answer);
- }
- else
- {
- Console.WriteLine("Good try, but no: {the random number} % {the other random number} = {0}", not sure, not sure, answer)
- }
Add Comment
Please, Sign In to add comment