Program to trim a given character from a string.
Answer Posted / dj
#include<iostream>
using namespace std;
#include<string.h>
int main()
{
char string[]="lhellolollla";
int i=0;
int count=0;
while(i<strlen(string))
{
while(string[i+count]=='l')
count++;
string[i]=string[i+count];
i++;
}
printf("%s",string);
}
Is This Answer Correct ? | 5 Yes | 0 No |
Post New Answer View All Answers
What does static variable mean in c?
How can I find out if there are characters available for reading?
How do I convert a string to all upper or lower case?
How does #define work?
How can my program discover the complete pathname to the executable from which it was invoked?
Where static variables are stored in c?
What is your stream meaning?
we need to calculating INCOME TAX for the person. The INCOME TAX is as follows:- First $10000/- of income : 4% tax Next $10000/- of income : 8% tax Next $10000/- of income : 11.5% tax above $10, 00,00/- : 15% tax What is the Solution of this Question ?
Are there any problems with performing mathematical operations on different variable types?
What is quick sort in c?
WRITE A PROGRAM TO MERGE TWO SORTED ARRAY USING MERGE SORT TECHNIQUE..
Write a code to generate a series where the next element is the sum of last k terms.
How many keywords (reserve words) are in c?
Do you know the purpose of 'register' keyword?
What does void main return?