RAND5 to RAND7 : Bhagalpur SIr
3 posters
Page 1 of 1
RAND5 to RAND7 : Bhagalpur SIr
Given a function RAND5 that genrates random numbers in the range 0 t0 5
write afunction that RAND7
google question
write afunction that RAND7
google question
ballu- Posts : 58
Join date : 2009-02-01
Re: RAND5 to RAND7 : Bhagalpur SIr
int RAND7() {
return ((RAND5+RAND5+RAND5+RAND5+RAND5+RAND5+RAND5 ) /5 );
}
does (7*RAND5)/5 , do the same thing??
return ((RAND5+RAND5+RAND5+RAND5+RAND5+RAND5+RAND5 ) /5 );
}
does (7*RAND5)/5 , do the same thing??
ramthegreatcv- Posts : 55
Join date : 2009-01-30
Age : 35
@RAM P
7*RAnd5/ 5 wont be the same thing
becoz the output fro rand is diff for each of the calls??
btw: In ur solution the probability of all the digits is not the same ??
becoz the output fro rand is diff for each of the calls??
btw: In ur solution the probability of all the digits is not the same ??
ballu- Posts : 58
Join date : 2009-02-01
@Ramp
in ur solution the probability of occurrence of all digits is not same
ballu- Posts : 58
Join date : 2009-02-01
Similar topics
» REVRSE:Bhagalpur Sir
» Constrcutor:Bhagalpur SIr
» Sizeof :bhagalpur Sir
» Design a datastructure - Bhagalpur SIr
» FIBONACCI recursion modified:Bhagalpur Sir
» Constrcutor:Bhagalpur SIr
» Sizeof :bhagalpur Sir
» Design a datastructure - Bhagalpur SIr
» FIBONACCI recursion modified:Bhagalpur Sir
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum
|
|