I have to generate a random number by taking the input as a timer value... SO can anyone suggest how to get this????
Thanks in Advance
"...a really bad idea, am I right?"
Yes, you are right.
No, it is nothing to do with April 1st. I really did see that line of code!
The line of code was being executed close to the start of main, so the seed for the pseudo-random number generator had been set by the initialisation of the library. The first random number produced was identical from one reset to another. So the value passed to srand was always the same. So subsequent calls to rand always produced the same sequence of values.