In C, what is the value of RAND_MAX?
En C, the value of RAND_MAX depends of the compiler or library implementation.
For portability reasons, the standard requires this value to be greater than or equal to 32767.
To know the value on a given compiler, simply run the following code:
#include <stdio.h>
#include <stdlib.h>
int main()
{
printf("%d", RAND_MAX);
return 0;
}
En C, the value of RAND_MAX depends of the compiler or library implementation.
For portability reasons, the standard requires this value to be greater than or equal to 32767.
To know the value on a given compiler, simply run the following code:
#include <stdio.h>
#include <stdlib.h>
int main()
{
printf("%d", RAND_MAX);
return 0;
}
En C, the value of RAND_MAX depends of the compiler or library implementation.
For portability reasons, the standard requires this value to be greater than or equal to 32767.
To know the value on a given compiler, simply run the following code:
#include <stdio.h>
#include <stdlib.h>
int main()
{
printf("%d", RAND_MAX);
return 0;
}
| # | ID | Query | URL | Count |
|---|---|---|---|---|
| 0 | 12621 | en | https://en.ans.wiki/5895/in-c-what-is-the-value-of-rand_max | 7 |