0

Question (C#)

How do I make randomized variables with randomized int? ex. int Example = 1; int Example = 2; int Example = 3; int Example = 4; Console.WriteLine(Example); Expected Outputs: Random Number (1, 2, 4, 3) The output says its an error. Instead of choosing random numbers from that variable, it iust gave me an error. Any ideas?

3rd Oct 2022, 7:26 AM
Thomas Pacia
Thomas Pacia - avatar
3 Answers
+ 1
You re-declared Example, that results in an error. Read here and adjust the examples to your needs. https://www.w3schools.blog/c-random-number-between-1-and-100
3rd Oct 2022, 8:30 AM
Lisa
Lisa - avatar
0
Can you please share your code.?
3rd Oct 2022, 8:30 AM
A S Raghuvanshi
A S Raghuvanshi - avatar
4th Oct 2022, 4:35 AM
Thomas Pacia
Thomas Pacia - avatar