Reginaldojs

exercicio 6,lista 3

Jun 14th, 2012
39
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.43 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<stdlib.h>
  3. #include<time.h>
  4. int main(){
  5.     int n,f,sorteado;
  6.     srand(time(NULL));
  7.     printf("digite a quantidade de numeros a serem sorteados:\n");
  8.     scanf("%d",&n);
  9.     printf("entre com a faixa do sorteio:");
  10.     scanf("%d",&f);
  11.     int i=0;
  12.     while(i<n){
  13.         sorteado=(rand()%f)+1;
  14.         printf("%d\t",sorteado);
  15.         i++;
  16.         }
  17.     system ("pause");
  18.     return 0;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment