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


Please Help Members By Posting Answers For Below Questions

What are the Advantages of using macro

688


What is static memory allocation? Explain

632


What is the purpose of main( ) in c language?

623


What is a 'null pointer assignment' error?

726


What are formal parameters?

661






Can we declare function inside main?

570


How do you convert a decimal number to its hexa-decimal equivalent.Give a C code to do the same

649


a function gets called when the function name is followed by a a) semicolon (;) b) period(.) c) ! d) none of the above

874


What is c language used for?

559


What is dangling pointer in c?

625


Is c high or low level?

583


How do I convert a string to all upper or lower case?

629


What type of function is main ()?

588


Why is event driven programming or procedural programming, better within specific scenario?

1955


What is 1d array in c?

602