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()
    {
    printf("%d\n", rand() % 500);
    return 0;
    }
    1. 500
    2. Compilation Error
    3. Garbage value
    4. An integer between 0-499 including 0 and 499
    5. None of these
Correct Option: D

An integer between 0-499 including 0 and 499



Your comments will be displayed only after manual approval.