Random number challenge
William Attwood
wattwood at gmail.com
Wed Jun 11 21:02:03 MDT 2008
<?php
echo rand(1, 100);
?>
On Wed, Jun 11, 2008 at 6:39 PM, Alex Esplin <alex.esplin at gmail.com> wrote:
> #include <stdio.h>
> #include <stdlib.h>
> #include <time.h>
> #include <string.h>
>
> int main(int argc, char* argv[]) {
>
> srand(time(0));
> int members = atoi(argv[1]);
> int r = rand() % members + 1;
>
> printf("Your number is: %d\n", r);
>
> return 0;
> }
>
> I can remember that every time. I do it lots.
>
> --
> Alex Esplin
>
> /*
> PLUG: http://plug.org, #utah on irc.freenode.net
> Unsubscribe: http://plug.org/mailman/options/plug
> Don't fear the penguin.
> */
>
More information about the PLUG
mailing list