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 what is a program flowchart and explain how does it help in writing a program?
What is c definition?
What is a structure and why it is used?
What is graph in c?
What is function definition in c?
How do I copy files?
Create a structure to specify data on students as given below: Roll number, Name, Department, Course, and Year of joining. Assume that there are not more than 450 students in the collage. (a) Write a function to print the names of all students who joined in the last 3 years. (b) Write a function to print the data of a student whose roll numbers are divisible by 4.
How can I make it pause before closing the program output window?
Write a program to show the change in position of a cursor using c
Why is #define used?
to find the closest pair
How do you determine a file’s attributes?
Program to find the sum of digits of a given number until the sum becomes a single digit. (e.g. 12345=>1+2+3+4+5=15=>1+5=6)
Under what circumstances does a name clash occur?
Can the sizeof operator be used to tell the size of an array passed to a function?