CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
subroutine and random number generator

 



kobe004mvp
New User

Apr 12, 2007, 4:18 PM

Post #1 of 2 (221 views)
subroutine and random number generator Can't Post

write a subroutine that generates pseudorandom numbers using the formula Xj+1 = AXj + C , modulus M, with X=2, C=3, M=4. Demonstrate the subroutine in a program that prompts the user for the "seed" Xo and then outputs on the screen a sequence of 50 pseudorandom numbers, one per line.



I have no idea how to go about the problem so any help would be much appreciated.

Stella


KevinR
Veteran


Apr 12, 2007, 7:13 PM

Post #2 of 2 (218 views)
Re: [kobe004mvp] subroutine and random number generator [In reply to] Can't Post

Maybe you should have stayed awake in class? Wink
-------------------------------------------------

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives