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

Explain function?

890


my project name is adulteration of chille powder.how can i explain it to the hr when he asks me about the project?

1370


You are to write your own versions of strcpy() and strlen (). Call them mystrcpy() and mystrlen(). Write them first as code within main(), not as functions, then, convert them to functions. You will pass two arrays to the function in the case of mystrcpy(), the source and target array.

2093


What is the use of in c?

781


Explain low-order bytes.

841


Explain how do you search data in a data file using random access method?

921


1.int a=10; 2.int b=20; 3. //write here 4.b=30; Write code at line 3 so that when the value of b is changed variable a should automatically change with same value as b. 5.

1938


Can you apply link and association interchangeably?

907


Compare interpreters and compilers.

852


Can you explain the four storage classes in C?

889


If i have an array 0 to 99 i.e,(Size 100) I place the values 1 to 100 randomly like a[0]=29,a[1]=56 upto array[99].. the values are only between 1 to 100. getting the array values by using scanf.. If i entered one wrong element value line a[56]=108. how can i find it.. and also how to find the missing value in 1 to 100.. and i want to replace the missing values.. any one of them know please post your answer..

1809


difference between Low, Middle, High Level languages in c ?

1879


Where register variables are stored in c?

775


What is the difference between functions abs() and fabs()?

906


What are the disadvantages of a shell structure?

976