int a=(int)rand()%1001;   //1-1000

int b=(int)rand()%2;   // 0-1
On Fri, Jul 15, 2011 at 3:01 PM, SkRiPt KiDdIe <[email protected]>wrote:

> You are provided with a bit generator which generates 1 and 0 with equal
> probabilities i.e. (1/2). You are required to design a function which
> generates numbers form 1-1000 with equal probabilities i.e. (1/1000).
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>



-- 
**Regards
SAGAR PAREEK
COMPUTER SCIENCE AND ENGINEERING
NIT ALLAHABAD

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to