Write a program for deleting duplicate elements in an array
Answer Posted / bhanuprakash a
/* here is the actual logic */
for(i=1; i<n; i++)
{
for(j=i+1;j<=n;j++)
{
if(a[i] = a[j])
{
for(k=j;k<n;k++)
{
a[k]=a[k+1]; //deletion
n=n-1;
}
}
}
}
Is This Answer Correct ? | 7 Yes | 8 No |
Post New Answer View All Answers
What is a constant and types of constants in c?
What is hashing in c language?
Explain how can a program be made to print the line number where an error occurs?
Does c have circular shift operators?
What are the ways to a null pointer can use in c programming language?
What does p mean in physics?
How to compare array with pointer in c?
What are the advantages and disadvantages of pointers?
if (i = 0)printf ("True"); elseprintf("False"); Under what conditions will the above print out the string "True" a) Never b) Always c) When the value of i is 0 d) all of the above
When is a void pointer used?
What is the use of bitwise operator?
program to find out date after adding 31 days to a date in the month of febraury also consider the leap year
Explain what is the difference between null and nul?
Explain enumerated types.
What is a pointer on a pointer in c programming language?