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 quantidade, i, faixa, num;
- srand(time(NULL));
- printf("Determine a quantidade de numeros aleatorios a serem exibidos: ");
- scanf ("%d", &quantidade);
- printf ("Determine a faixa do sorteio: ");
- scanf ("%d", &faixa);
- i=0;
- for (i>=0;i<quantidade;i++)
- {
- num=(rand()%faixa)+1;
- printf ("%d ",num);
- }
- return(0);
- }
Advertisement
Add Comment
Please, Sign In to add comment