The ____ function can be used to generate a random number in the standard library.
A. rand()
B. srand()
C. random()
D. rnd()
查看答案
____ reads the computer’s internal clock time, in seconds in the standard library.
A. stime()
B. time(SECONDS)
C. time()
D. time(NULL)
Scaling a random number as an integer value between 1 and N is accomplished using the expression ____.
A. 1 + (int)rand() / N
B. 1 + (int)rand() % N
C. (int)rand() / N
D. (int)rand() % N
The function ____ returns a non-0 number if the argument is a letter or a digit; otherwise it returns a 0.
A. int isalnum(int)
B. int isalpha(int)
C. int isdigit(int)
D. int isxdigit(int)
Failure to exactly match the return value with the function’s declared data type can lead to undesired results because the return value is always converted to the data type declared in the function’s header line.