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

cavium networks written test pattern ..

3596


An organised method of depicting the use of an area of computer memory used to signify the uses for different parts of the memory a) swap b) extended memory c) memory map d) all of the above

707


What are loops in c?

551


What is #ifdef ? What is its application?

649


Are pointers integers in c?

611






What is the use of bit field?

644


Why is c faster?

593


What is difference between main and void main?

630


Where we use clrscr in c?

708


How can I write data files which can be read on other machines with different word size, byte order, or floating point formats?

614


Difference between Shallow copy and Deep copy?

1572


What is static memory allocation? Explain

632


What are logical errors and how does it differ from syntax errors?

661


What are the advantages of the functions?

606


How do you define a function?

583