adplus-dvertising
frame-decoration

Question

What is the output of this C code?
#include <stdio.h>
    #include <stdlib.h>
    int main()
    {
        srand(9000);
        printf("%d\n", rand());
        return 0;
    }

a.

Compile time error

b.

An integer in the range 0 to RAND_MAX

c.

A double in the range 0 to 1

d.

A float in the range 0 to 1

Posted under C Programming

Answer: (b).An integer in the range 0 to RAND_MAX

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. What is the output of this C code?