How to write a code for random pick from 1-1000 numbers?
The output should contain the 10 numbers from the range
1-1000 which should pick randomly, ie ,for each time we run
the code we should get different outputs.
Answer Posted / nischal e rao
The best way to solve this problem would be to create a hash
function and apply the current time to as the argument to
the hash function. the hash function should be designed to
return a number between 1 to 1000.
Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
What are the Advantages of using macro
What is static memory allocation? Explain
What is the purpose of main( ) in c language?
What is a 'null pointer assignment' error?
What are formal parameters?
Can we declare function inside main?
How do you convert a decimal number to its hexa-decimal equivalent.Give a C code to do the same
a function gets called when the function name is followed by a a) semicolon (;) b) period(.) c) ! d) none of the above
What is c language used for?
What is dangling pointer in c?
Is c high or low level?
How do I convert a string to all upper or lower case?
What type of function is main ()?
Why is event driven programming or procedural programming, better within specific scenario?
What is 1d array in c?