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
Explain why can’t constant values be used to define an array’s initial size?
How #define works?
Can a void pointer point to a function?
What is pointer and structure in c?
What is the difference between class and object in c?
Tell me is null always defined as 0(zero)?
When the macros gets expanded?
In the DOS enveronment, normal RAM that resides beyond the 1mb mark. a) expanded memory b) swapped memory c) Extended memory d) none
Which one to choose from 'initialization lists' or 'assignment', for the use in the constructor?
we called a function and passed something do it we have always passed the "values" of variables to the called function. such functions calles are called a) calls by reference b) calls by value c) calls by zero d) none of the above
What are the types of unary operators?
WHICH TYPE OF JOBS WE GET BY WRITING GROUPS .WHEN THE EXAMS CONDUCTED IS THIS EXAMS ARE CONDUCTED EVERY YEAR OR NOT.PLS TELL ME THE ANSWER
Explain what are binary trees?
What are structure types in C?
What is c token?