C-Library-Functions
- What will be the output of the following C code?
#include <stdio.h>
#include <stdlib.h>
int main()
{
srand(1000);
printf("%d\n", rand());
return 0;
}
-
View Hint View Answer Discuss in Forum
NA
Correct Option: D
An integer in the range 0 to RAND_MAX
- What will be the output of the following C code?
#include <stdio.h>
#include <stdlib.h>
int main()
{
printf("%d\n", rand() % 500);
return 0;
}
-
View Hint View Answer Discuss in Forum
NA
Correct Option: D
An integer between 0-499 including 0 and 499
- For the function call time(), what type of parameter is accepted?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: B
time_t *
- Which among the following is correct function call for rand() and random()?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: D
rand() and random();
- Which of the following snippet will effectively generate random numbers?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: C
rand();