write a c prog for removing duplicate character from an
array and sorting remaining elements using a single array
Answer / b sohan lal
#include<stdio.h>
#include<conio.h>
#include<string.h>
void main()
{
char s[15],a[15];
int i,j,n;
clrscr();
printf("enter the string");
scanf("%s",s);
for(i=0;s[i]!='\0';i++)
{
if(s[i]!=s[i+1])
a[i]=s[i];
}
n=strlen(a);
for(i=0;s[i]!='\0';i++)
{
for(j=0;j<=n-i-1;j++)
{
if(a[j]>=a[j+1])
{
temp=a[j];
a[j]=a[j+1];
a[j+1]=temp;
}
}
}
printf("the sorted string is:%s",a);
getch();
}
| Is This Answer Correct ? | 2 Yes | 2 No |
what is the return type of printf
What is main return c?
write a progrmm in c language take user interface generate table using for loop?
What is the modulus operator?
without a terminator how can we print a message in a printf () function.
write a program to convert a expression in polish notation (postfix) to inline (normal) something like make 723+* (2+3) x 7 (not sure) just check out its mainly printing expression in postfix form to infix
Can you explain what keyboard debouncing is, and where and why we us it? please give some examples
What language is lisp written in?
why ordinary variable store the later value not the initial
why we use "include" word before calling the header file. is there any special name for that include??????
What is extern storage class in c?
What is meant by global static? why we have to use static variable instead of Global variable