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 are the properties of union in c?

815


How can I write a function that takes a format string and a variable number of arguments?

837


void main(int n) { if(n==0) return; main(--n); printf("%d ",n); getch(); } how it work and what will be its output...............it any one know ans plz reply

2511


What are variables and it what way is it different from constants?

1019


Why can’t we compare structures?

1050


What functions are in conio h?

899


Input is "rama loves rajesh and rajesh Loves rama also and rajesh wear gloves and bloves" To print output is count the numbers of times repeted the word love without case sensitive.

1853


What are # preprocessor operator in c?

872


Explain threaded binary trees?

912


How do I round numbers?

788


Why malloc is faster than calloc?

814


Is c is a middle level language?

812


Which is not valid in C a) class aClass{public:int x;}; b) /* A comment */ c) char x=12;

846


An arrangement of information in memory in such a way that it can be easily accessed and processed by a programming language a) string b) data structure c) pointers d) array

915


Write a program to swap two numbers without using the third variable?

823