So I have this code:
#include <stdio.h>
#include <stdlib.h>
int main() {
char a[200], b = 0;
int x;
x = 100 + rand() % 200;
for (int i = 0; i < x; i++) {
a[i] = 'a' + rand() % 26;
}
for (int i = 0; i < x; i++) {
if (b % 10 == 0) {
printf("\n%c ", a[i]);
b = 0;
}
else {
printf("%c ", a[i]);
}
b++;
}
printf("\n");
return 0;
}
Purpose is that I should generate random array of letters from 'a' to 'z' (which I've managed to do) and after that print new array without elements that repeat in first array. I've tried implementing code from here for removing duplicate elements but it didn't worked in my code.