![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Newbie
Join Date: Apr 2005
Posts: 1
Rep Power: 0
![]() |
I need a program that helps students learn multiplication. Im supposed to use
rand to produce two positive one digit integers. when the student types the answer, the program checks it and if it is wrong it prints wrong answer and lets them try again. if it is right it prints right answer and gives another problem |
|
|
|
|
|
#2 |
|
I eat cake for breakfast.
![]() ![]() ![]() ![]() Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9
![]() |
I suggest reading up on the rand() function.
|
|
|
|
|
|
#3 |
|
Expert Programmer
Join Date: Sep 2004
Location: Ontario, Canada
Posts: 555
Rep Power: 5
![]() |
srand((unsigned)time(NULL)); //use that to set the evil seed rand()%9; //that will give you a random number between 0 and 9
__________________
Johnny was a chemist's son but Johnny is no more, for what Johnny thought was H2O was H2SO4 |
|
|
|
|
|
#4 |
|
Newbie
|
rand() % 10;
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|