i need help about writing lottery program...

subject is:

Write a program which allows to simulate a lottery. In the lottery, the user first bets six numbers
from 1 to 49. Then the program generates six random numbers several times, until the user wins
all the six numbers that he has bet. Display the information after how many trials the user won.

Thanks a lot...
You need to show us the code you have written and explain where you need help...
problem is i even didnt start...
its kind of a hard question for me thats why i need help ...
Well, just use the rand() function and give it a seed with srand().. A good seed would be to use the current time on the computer to always be generating different numbers.

It's been a while since I've tried generating random numbers so forgive me... I can't really remember which header files you need to include besides ctime :P
Last edited on
Topic archived. No new replies allowed.