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 / dayquest
#include<stdio.h>
#include<stdlib.h>
#include<time.h>
void main()
{
int i;
randomize();
printf("\n Ten random numbers between 1 and 1000 are \n");
for(i=0;i<10;i++)
printf("%d ",random(1000)+1);
getch();
}
| Is This Answer Correct ? | 0 Yes | 2 No |
Post New Answer View All Answers
What is a floating point in c?
Explain how do you sort filenames in a directory?
write a program to print data of 5 five students with structures?
What is the total generic pointer type?
What is the full form of getch?
What is this infamous null pointer, anyway?
When I tried to go into a security sites I am denied access and a message appeared saying 'applet not initialize'. How can I rectify this problem.
How can you access memory located at a certain address?
What are the advantages of c language?
How main function is called in c?
Tell me what are bitwise shift operators?
Design a program which assigns values to the array temperature. The program should then display the array with appropriate column and row headings.
Explain 'bus error'?
Explain what is a static function?
What is the purpose of void in c?