C-Library-Functions


  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. View Hint View Answer Discuss in Forum

    NA

    Correct Option: D

    An integer in the range 0 to RAND_MAX


  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. View Hint View Answer Discuss in Forum

    NA

    Correct Option: D

    An integer between 0-499 including 0 and 499



  1. For the function call time(), what type of parameter is accepted?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: B

    time_t *


  1. Which among the following is correct function call for rand() and random()?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: D

    rand() and random();



  1. Which of the following snippet will effectively generate random numbers?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: C

    rand();