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
Define macros.
Write the Program to reverse a string using pointers.
code for find determinent of amatrix
How are Structure passing and returning implemented by the complier?
What is integer constants?
Why does the call char scanf work?
Explain is it better to use a pointer to navigate an array of values, or is it better to use a subscripted array name?
What is the acronym for ansi?
Define the scope of static variables.
How can I make it pause before closing the program output window?
Distinguish between actual and formal arguments.
What is the newline escape sequence?
Is c is a low level language?
What is the difference between malloc calloc and realloc in c?
How can I insert or delete a line (or record) in the middle of a file?