how to create a random question except variable=rand()%%26lt;total numberof question%26gt;...
Assuming that you create a quiz game using c language.?
If you're asking how to do it without using a random function, it's like displaying the answer without using a display function, or making an omelet without using eggs. Meatless Meatballs!
However you do it, getting a random question requires a random function. If it's not a random function, you're not getting a random question. You can write your own random function (although why you'd want to is beyond me - it's not easy to write a good pseudorandom generator unless you have hardware that generates random numbers), but you're still using a random function.
Reply:you need a data structure, like an array for instance, to hold all of the questions. Then you can access them randomly with your little expression there.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment