diff --git a/algorithms/C/arrays/removing_duplicates_from_array.c b/algorithms/C/arrays/removing_duplicates_from_array.c new file mode 100644 index 00000000..4c9300bc --- /dev/null +++ b/algorithms/C/arrays/removing_duplicates_from_array.c @@ -0,0 +1,58 @@ +//This code removes duplicates from a sorted array +//For example we enter the array -:5 6 6 7 8 8 +//The the output will be -: 5 6 7 8 + + +#include + +void removeDuplicates(int arr[], int size){ + + int newsize = size;//keeping track of array size + + for(int i=0,j=i+1;j