Randomize Function In Dev C++

Randomize Function In Dev C++

  1. Randomize Function In Dev C Pdf

C library function - rand - The C library function int rand(void) returns a pseudo-random number in the range of 0 to RANDMAX. Randomise Function. I have been working with many c projects but never came across randomize function. Is it user defined or inbuilt function? 'randomize' is not a standard C function. I'm not sure where you found it, but it is not standard, so it is not found on all C/C compilers. The standard function is called rand. This function should be available on a all C compilers. In order to use rand, you need to include the standard header file.

  • The C Standard Library
  • C Standard Library Resources
  • C Programming Resources
  • Selected Reading

Description

The C library function int rand(void) returns a pseudo-random number in the range of 0 to RAND_MAX.

RAND_MAX is a constant whose default value may vary between implementations but it is granted to be at least 32767.

Declaration

Following is the declaration for rand() function.

Parameters

  • NA

Return Value

This function returns an integer value between 0 and RAND_MAX.

Randomize Function In Dev C++Randomize Function In Dev C++

Example

The following example shows the usage of rand() function.

Let us compile and run the above program that will produce the following result −

Randomize Function In Dev C Pdf

stdlib_h.htm