Unlimited Faxes, No Fees, Dedicated Phone Number
#define ALEATORIOS 10
#include <stdio.h>
#include <conio.h>
#include <stdlib.h>
#include <time.h>
int main(){
int vet[ALEATORIOS],aux,num,cont=0;
bool achou;
printf("Aleatorios sem repeticao:\n->");
srand(time(NULL));
while(cont < ALEATORIOS ) {
num = 1 + rand()% ALEATORIOS;
for(aux=0;aux< ALEATORIOS;aux++){
if (num == vet[aux]) { achou = true; }
}
if (achou == false) {
vet[cont] = num;
printf("%d ",vet[cont]);
cont++;
}
achou = false;
}
getch();
return 0;
}