Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Apr 3rd, 2005, 5:48 PM   #1
caremel
Newbie
 
Join Date: Apr 2005
Posts: 1
Rep Power: 0 caremel is on a distinguished road
Question multiplication program

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
caremel is offline   Reply With Quote
Old Apr 3rd, 2005, 6:53 PM   #2
Ooble
I eat cake for breakfast.
 
Ooble's Avatar
 
Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9 Ooble is on a distinguished road
I suggest reading up on the rand() function.
__________________
Me :: You :: Them
Ooble is offline   Reply With Quote
Old Apr 3rd, 2005, 7:06 PM   #3
Benoit
Expert Programmer
 
Benoit's Avatar
 
Join Date: Sep 2004
Location: Ontario, Canada
Posts: 555
Rep Power: 5 Benoit is on a distinguished road
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
Benoit is offline   Reply With Quote
Old Apr 3rd, 2005, 7:32 PM   #4
Donald Ferrone
Newbie
 
Donald Ferrone's Avatar
 
Join Date: Mar 2005
Posts: 19
Rep Power: 0 Donald Ferrone is on a distinguished road
Send a message via MSN to Donald Ferrone
rand() % 10;
Donald Ferrone is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 9:59 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC