adplus-dvertising
frame-decoration

Question

In the below program everytime program is run different numbers are generated.
#include <stdio.h>
    int main()
    {
        srand(time(NULL));
        printf("%d\n", rand());
        return 0;
    }

a.

True

b.

False

c.

Depends on the platform

d.

Depends on the compiler

Posted under C Programming

Answer: (a).True

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. In the below program everytime program is run different numbers are generated.