Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
eliminate_duplicates.c
//gcc 5.4.0 #include <stdio.h> void eliminate_duplicates(int ,int []); int main(void) { int n, arr[25]; scanf("%d", &n); for (int i = 0;i < n;i++) scanf("%d", &arr[i]); eliminate_duplicates( n, arr); return 0; } /* Accept integer array of n; Eliminate duplicate elements and print unique elements */ void eliminate_duplicates(int n,int arr[]) { int count = 0, flag = 1; for (int i = 0;i < n;i++) { for (int j = 0;j < n;j++) { if (arr[i] == arr[j]) { count++; } } if (count == 1) { printf("%d ",arr[i]); flag = 0; } count = 0; } if (flag) printf("-1"); }
run
|
edit
|
history
|
help
0
c4
sort_using_pointers.c
void *
Intro coding hello world
C_141127_MatrizProducto
ele709 3.5 finished
bitwise_operation__end-of-class
left significant peace as unison real manual user
Greeting
demo_strlen