#include<stdio.h>
#include<conio.h>
int main()
{
int x[10],y[10],i,j,k=0;
printf("Enter the 10 elements");
for(i=0;i<10;i++)
scanf("%d",&x[i]);
// logic Part start
for(i=0;i<10;i++)
{
for(j=0;j<k;j++)
{
if(y[j]==x[i])
break;
}
if(j==k)
{
y[k]=x[i];
k++;
}
}
// logic Part End
printf("Final result is ");
for(i=0;i<k;i++)
printf("%d ",y[i]);
getch();
return 0;
}
Enter the 10 elements
40
40
10
20
52
52
41
40
10
10
Final result is 40 10 20 52 41
--------------------------------
Process exited after 18.9 seconds with return value 0
Press any key to continue . . .