Which of the following code will give an error?
A.
#include <stdlib.h>
int main()
{
printf("%d\n", srand());
return 0;
}
B.
#include <stdlib.h>
int main()
{
srand(time(0));
printf("%d\n", rand()%50);
return 0;
}
C.
#include <stdlib.h>
int main()
{
srand(1);
return 0;
}
D.
#include <stdlib.h>
int main()
{
printf("%d\n", rand()%50);
return 0;
}
Answer: Option A
Join The Discussion