No.
I don't believe 'srand ' is an English word , -gibberish.
It is an abbreviation for Local Area Network.
laugh out loud od lots of love
Srand (seed random ) is used to seed random numbers and is used before calling the rand() or the random number generator. Seeding random numbers ensures that each time the code is executed the number generated is completely random. srand requires one parameter. For most cases it is sufficient to make this parameter time(NULL) [remember to include time.h] as this will seed a new bunch of random number every second
The header file for random functions ( like rand(), srand() ) is stdlib.h in C and cstdlib in C++.
RAND: Rand uses a multiplicative congruential random number generator with period232 to return successive pseudo-random numbers in the range 0 to RAND_MAX. Return Value: Rand returns the generated pseudo-random number. RANDOM(): Random returns a random number between 0 and (num-1).random(num) is a macro defined in STDLIB.H. RANDOMIZE(): Randomize initializes the random number generator with a random value. Because randomize is implemented as a macro that calls the time function prototyped in TIME.H, you should include TIME.H when you use this routine SRAND(): The random number generator is reinitialized by calling srand with an argument value of 1.The generator can be set to a new starting point by calling srand with a given seed number.
You can use rand(). Make sure that you use srand()to generate the seed for rand() (if you do not, you get so called pseudo random numbers).
This program generates so called pseudo random numbers, and it used srand() function to connect the seed for the random number generator to the current. Which makes it less predictable but cannot claimed as a real random number generator.#include #include #include int main(){srand((unsigned) time(NULL));std::cout
The c doesn't srand for anything. It's just part of the word. Btw, are yyou doing a project on cellphones perhaps?
#include <stdio.h> #include <stdlib.h> #include <time.h> int GetRand( int min, int max) { // Swap min and max if wrong way around. if(max<min)min^=max^=min^=max; return(rand()%(max-min+1)+min); } int main() { // Seed the random number generator with current time to ensure // random numbers are different on each run. // Note: use srand(1) to generate the same sequence on every run. srand((unsigned)time(NULL)); printf("Number from 0 to 10 : %d\n", GetRand(0,10)); printf("Number from 1 to 100: %d\n", GetRand(1,100)); return(0); }
True random numbers need a number frame to give it space. Try perl. type in $randomnumber1=int(rand(200))+1; you can change the 200 to anything you like and it will generate a random number between whatever your number is and one.
Use the function "rand()" or "mt_rand()". Both functions will generate a random number (as a return value, so be sure to make it point to a variable - see examples). However, "rand()" is slower and uses a default PHP randomizing system. mt_rand() is four times as fast, and uses the Mersenne Twister randomizing format - which is much more random. Both functions have two optional parameters - a minimum integer and a maximum integer, respectively. By filling in these parameters, you will get a random number between the values you give (so, giving one and five will give you a random number that is no less than one, and no greater than five). These, again, are optional - and if left blank, the tiniest integer possible is no less than 0, and the largest integer possible is generated by the PHP function "getrandmax()" / "mt_getrandmax()" automatically. Examples, of which all are acceptable: ---- /* Examples using no parameters */ $randomNumber = rand(); $randomNumber = mt_rand(); /* Examples using parameters */ $randomNumber = rand(1, 5); $randomNumber = mt_rand(6, 10); ---- If your PHP build is version 4.2 or under, you will need to seed the random number generator with a value to base off of. "srand()" and "mt_srand()" (to be used with rand() and mt_rand() functions, respectively) can be used in this case. They both only have one optional parameter, which is any seed value - any number. If omitted, a random seed will be generated. More acceptable examples: ---- // Example using no parameters srand(); $randomNumber = rand(); // Example using the seed parameter srand(12345); $randomNumber = rand(); // Example using the "mt" random format functions (without parameters) mt_Rand(); $randomNumber = mt_rand(); // Example using the "mt" random format (with parameters) mt_rand(12345); $randomNumber = mt_rand(); ----