would someone help me with my visual studio c# code please?
So I'm using c# visual studio to create a code that will generate a random question when one hits the button, and when one hits another button, the answer to that question will be generated. My problem is that i am having trouble defining a random integer that will work for both buttons. From what I am gathering on the internet, C# doesnt have global variables that can be accessed by both of my buttons. Right now, my approach was to generate a random integer, and depending on that integer have question 1 generate, and then when they click the Show Answer button have answer 1 generate. But if anyone has any ideas on how I might make the question / answer work, I would be very grateful. While it wont run on sololearn, i will still post what code i do have. https://code.sololearn.com/c9OM3cONbJdf/?ref=app Edit: Thanks guys! It works now!