Examveda

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


This Question Belongs to Data Structure >> Miscellaneous On Data Structures

Join The Discussion

Related Questions on Miscellaneous on Data Structures