Home » C Programming » C-Library-Functions » Question
  1. 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;
    }
    1. A double in the range 0 to 1
    2. Compilation Error
    3. A float in the range 0 to 1
    4. An integer in the range 0 to RAND_MAX
    5. None of these
Correct Option: D

An integer in the range 0 to RAND_MAX



Your comments will be displayed only after manual approval.