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 n,f,sorteado;
- srand(time(NULL));
- printf("digite a quantidade de numeros a serem sorteados:\n");
- scanf("%d",&n);
- printf("entre com a faixa do sorteio:");
- scanf("%d",&f);
- int i=0;
- while(i<n){
- sorteado=(rand()%f)+1;
- printf("%d\t",sorteado);
- i++;
- }
- system ("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment