Hey,
i have a code here that scans 10 integers and prints them without they're double.
If i print 1234356792 my output will be 12345679
The code below shows how to do it but i need someone to explain me a loop that's there.
Code:
#include <stdio.h>
int main()
{
int arr[10];
int i, j, seen;
printf("Enter 10 integers:\n");
for (i=0; i<10 ; i++)
{
scanf("%d", &arr[i]);
}
printf("Set(array) is:");
for (i=0; i<10; i++)
{
seen = 0;
for (j=0; j<i; j++) // What does that mean?
{
if (arr[i]==arr[j])
{
seen=1; // what the 1 means?
break;
}
}
if(!seen)
printf("%d", arr[i]);
}
printf("\n");
return 0;
}
appreciate any help