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

  Main Index MAIN
Search Posts SEARCH
Who's Online WHO'S
Log in LOG

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


New User

Apr 12, 2007, 4:18 PM

Post #1 of 2 (223 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.



Apr 12, 2007, 7:13 PM

Post #2 of 2 (220 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