Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <time.h>
- int main()
- {
- int i,val,low,high,num;
- srand(time(NULL));
- printf("Entre com a quantidade de numeros a serem sorteados :\n");
- scanf("%d",&num);
- printf("Entre com o numero maximo e minimo do intervalo :\n");
- scanf("%d %d",&low,&high);
- for (i = 0; i < num; i++)
- {
- val = rand() % (high - low) + low;
- printf("%d\n",val);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment