adplus-dvertising
frame-decoration

Question

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

a.

Compile time error

b.

An integer between 0-1000

c.

An integer between 0-999 including 0 and 999

d.

An integer between 0-1000 including 1000

Posted under C Programming

Answer: (c).An integer between 0-999 including 0 and 999

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?