Note: C Standard Library (cstdlib) has been included for using srand and rand statements.
Q. What does it really mean if we use srand (5); in a program?
Ans: It means
that a set of predefined operations will be carried out at 5, and then a number
will be generated (using rand).
User can use this number. If called second time (using rand) again set of predefined operations will be performed to produce second number. These Operations are set in such a way that they produce random number.
User can use this number. If called second time (using rand) again set of predefined operations will be performed to produce second number. These Operations are set in such a way that they produce random number.
No comments:
Post a Comment