Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main()
- {
- int a[50], n, i, j, k;
- printf("Enter the number of elements: ");
- scanf("%d", &n);
- printf("Enter the elements: ");
- for (i = 0; i < n; i++) {
- scanf("%d", &a[i]);
- }
- printf("Unique eliments are: \n");
- for (i = 0; i < n; i++) {
- k = 0;
- for (j = 0; j < n + 1; j++) {
- if (i != j) {
- if (a[i] == a[j])
- k++;
- }
- }
- if (k == 0)
- printf("%d ", a[i]);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement