How do I sort a% number of% numbers in the C language in which I can exclude the possibility of drawing a certain number from my range given a given condition?
Exemplifying in code:
#include <stdio.h>
#include <time.h>
#include <stdlib.h>
int main(void)
{
int i,;
int x[8];
printf("Gerando 10 valores aleatorios:\n\n");
for(i=0;i<8;i++){
scanf("%d", &x[i]);
if(x[i]==3){
x[i] = rand()% 8 ("com exceção do i");
}
}
}
return 0;
}