#include
#include
#include
void main()
{
int *ar, i, j, n, y, t;
clrscr();
printf(“Enter the number of elements in the array”);
scanf(“%d”, &n);
ar=(int*) malloc(sizeof(int)*n);
for(i=0; iar[j])
{
t=arr[i];
ar[i]=ar[j];
ar[j]=t;
}
}
}
printf(“Elements of array after sorting”);
for(i=0; i
Output:
Enter the number of elements in the array:5
Enter a number: 3
Enter a number: 3
Enter a number: 4
Enter a number: 6
Enter a number: 4
Elements of array after sorting:
3
3
4
4
6
Elements of array after removing duplicate elements:
3
4
6