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 / sharan

if the randomize(); doesn't work
replace it with srand ((unsigned) time (NULL));

Is This Answer Correct ?    2 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the explanation for prototype function in c?

778


void main(){ int a; a=1; while(a-->=1) while(a-->=0); printf("%d",a); }

1518


What is a wrapper function in c?

869


Difference between malloc() and calloc() function?

918


What are reserved words?

886


Can include files be nested?

859


How main function is called in c?

861


What is a macro in c preprocessor?

877


Explain how do you use a pointer to a function?

880


Hai sir, I had planned to write the NIC scientific engineer exam , plz post the sample question......

1997


I just typed in this program, and it is acting strangely. Can you see anything wrong with it?

796


Explain c preprocessor?

898


In C language, the variables NAME, name, and Name are all the same. TRUE or FALSE?

1019


What are 'near' and 'far' pointers?

841


Why do we need a structure?

818