VitorH

Untitled

May 16th, 2012
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.45 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <time.h>
  4. int main()
  5. {
  6.     int quantidade, i, faixa, num;
  7.     srand(time(NULL));
  8.     printf("Determine a quantidade de numeros aleatorios a serem exibidos: ");
  9.     scanf ("%d", &quantidade);
  10.     printf ("Determine a faixa do sorteio: ");
  11.     scanf ("%d", &faixa);
  12.     i=0;
  13.     for (i>=0;i<quantidade;i++)
  14.     {
  15.         num=(rand()%faixa)+1;
  16.         printf ("%d ",num);
  17.     }
  18.     return(0);
  19. }
Advertisement
Add Comment
Please, Sign In to add comment