C Program to remove duplicate entries from array using recursion. Here is program without recursion, modify.?
-
C Program to remove duplicate entries from array using recursion. Here is program without recursion, modify.? #include<stdio.h> int main(){ int arr[50]; int *p; int i,j,k,size,n; printf("\nEnter size of the array: "); scanf("%d",&n); printf("\nEnter %d elements into the array: ",n); for(i=0;i<n;i++) scanf("%d",&arr[i]); size=n; p=arr; for(i=0;i<size;i++){ for(j=0;j<size;j++){ if(i==j){ continue; } else if(*(p+i)==*(p+j)){ k=j; size--; while(k < size){ *(p+k)=*(p+k+1); k++; } j=0; } } } printf("\nThe array after removing duplicates is: "); for(i=0;i < size;i++){ printf(" %d",arr[i]); } return 0; }
-
Answer:
I believe it's 43
Parvinde... at Yahoo! Answers Visit the source
Related Q & A:
- How to prevent duplicate entries in MySQL and PHP?Best solution by Stack Overflow
- How Can I use .net dll in C program?Best solution by Stack Overflow
- How can I remove duplicate Objects from array of Objects in javascript?Best solution by Stack Overflow
- How to run an executable from within a c program?Best solution by Stack Overflow
- Can anyone help me with this C++ program?Best solution by Yahoo! Answers
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.