calculating game

closed account (NhboizwU)
hi everyone, plz guide me. actually i m new here & want that computer randomly generate two numbers and one must add them in the defined time limit and type the correct answer, plz tell me how to generate random numbers and how to apply the time there??? thanks in advance plzzzzzzzzzzzz i will be higly thankful for that
check out

http://www.cplusplus.com/reference/clibrary/cstdlib/rand/

and

http://www.cplusplus.com/reference/clibrary/ctime/


when you use rand make sure you seed it... there's an example on the first page... write some code and I'll help you along the way.
If you're creating this program for Windows, maybe you could #include <windows.h> and use Sleep(time in milliseconds) for the defined time limit.
Topic archived. No new replies allowed.