-1
I am solving an exercise that asks to read a vector of 20 positions and print on the screen excluding repeated values, I was able to solve however, it is showing the values on the screen several times.
#include <stdio.h>
#include <stdlib.h>
int main()
{
int vet[20], x;
for(int i = 0; i < 20; i++)
{
printf("Digite um numero: ");
scanf("%d", &vet[i]);
}
for(int i = 1; i < 20; i++)
{
for(x = 0; x < 20; x++)
{
if(vet[i] != vet[x])
{
printf("\n%d", vet[x]);
}
}
}
}
Thank you so much, I was racking my brain here for something so simple kkkkk
– vitor sousa