just some code on random stuph

This is a discussion on just some code on random stuph within the C Programming forums, part of the General Programming Boards category; Code: //This is the header file to Initialize the function rando() #include <time.h> #include <stdlib.h> rando(int x); rando(int x) { ...

  1. #1
    Registered User
    Join Date
    Sep 2001
    Posts
    18

    just some code on random stuph

    Code:
    //This is the header file to Initialize the function rando()
    #include <time.h>
    #include <stdlib.h>
    rando(int x);
    rando(int x)
    {
        srand(time(NULL));
        return rand() % (x+1);
    }
    Code:
    #include <stdio.h>
    #include "head.h"
    int main()
    {
        printf("%d\n", rando(18));
        return 0;
    }
    HACKERS MANIFESTO (NOTE MOST WAS CUT OFF) (PEOPLE SAID IT WAS TOO LONG)
    This is our world now... the world of the electron and the switch, the beauty of the baud.
    We make use of a service already existing withoutpaying for what could be dirt-cheap if it wasn't run by profiteering gluttons, and you call us criminals.
    We explore... and you call us criminals.
    We seek after knowledge... and you call us criminals.
    We exist without skin color, without nationality, without religious bias... and you call us criminals.
    You build atomic bombs, you wage wars, you murder, cheat, and lie to us and try to make us believe it's for our own good, yet we're the criminals.

    Yes, I am a criminal. My crime is that of curiosity. My crime is that of judging people by what they say and think, not what they look like. My crime is that of outsmarting you, something that you will never forgive me for.

    I am a hacker, and this is my manifesto. You may stop this individual,but you can't stop us all... after all, we're all alike.
    +++The Mentor+++

  2. #2
    Budding Synth Programmer samGwilliam's Avatar
    Join Date
    Feb 2002
    Location
    Trefforest
    Posts
    368
    What, your crime is generating and displaying random numbers between 0 and 18? Jesus, bring in the tear gas and SWAT team...
    MSVC++ 6.0

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Lesson #3 - Math
    By oval in forum C# Programming
    Replies: 2
    Last Post: 04-27-2006, 08:16 AM
  2. Another brain block... Random Numbers
    By DanFraser in forum C# Programming
    Replies: 2
    Last Post: 01-23-2005, 04:51 PM
  3. << !! Posting Code? Read this First !! >>
    By biosx in forum C++ Programming
    Replies: 1
    Last Post: 03-20-2002, 11:51 AM
  4. Replies: 25
    Last Post: 10-28-2001, 12:08 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21