Predict the output of the following code.
#include <stdlib.h>
int main()
{
srand(0);
printf("%d\n", rand());
return 0;
}
#include <stdlib.h>
int main()
{
srand(0);
printf("%d\n", rand());
return 0;
}
A. compilation error
B. random number between 0 to RAND_MAX
C. cannot be predicted
D. 0
Answer: Option B
Join The Discussion