-
What will be the output of the following C code?
#include <stdio.h>
int main()
{
printf("%d\n", srand(12000))
return 0;
}
-
- A double in the range 0 to 12000
- Compilation Error
- An integer in the range 0 to 12000
- A float in the range 0 to 1
- None of these
Correct Option: B
Compilation Error
main.c: In function ‘main’:
main.c:4:24: warning: implicit declaration of function ‘srand’; did you mean ‘scanf’? [-Wimplicit-function-declaration]
printf("%d\n", srand(12000))
^~~~~
scanf
main.c:5:9: error: expected ‘;’ before ‘return’
return 0;
^~~~~~