its not a place that we can solve your homework problem.
still take some hints and show ur effort , the code you have tried so far.Then only you can expect something from this forum.
1)rand() function is used to generate random numbers.
int y=rand();
int num=(y-1)/y;
then you proceed with your next steps...
Thanks,
DP
Num will be always 0 :D
ithelp
Nearly a Posting Maven
2,230 posts since May 2006
Reputation Points: 769
Solved Threads: 128
> i tried but everytime it shows 0.00000
> and no other value
> i tried it another way....
Look, just post some actual code, and describe what doesn't work in that particular program.
Don't just post "I tried x y and z, and it didn't work".
We can't help you fix your mistakes if you never show us any code to begin with.
Salem
Posting Sage
11,531 posts since Dec 2005
Reputation Points: 5,862
Solved Threads: 953
for(i=0;i<40;i++); /* extraneous semicolon */
Dave Sinkula
long time no c
5,058 posts since Apr 2004
Reputation Points: 2,780
Solved Threads: 314