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 is a void * in c?
Explain how can you check to see whether a symbol is defined?
Which is the best website to learn c programming?
regarding pointers concept
How to Throw some light on the splay trees?
HOW TO SOLVE A NUMERICAL OF LRU IN OS ??????
What do you mean by recursion in c?
A float occupies 4 bytes in memory. How many bits are used to store exponent part? since we can have up to 38 number for exponent so 2 ki power 6 6, 6 bits will be used. If 6 bits are used why do not we have up to 64 numbers in exponent?
How can I invoke another program or command and trap its output?
Is this program statement valid? INT = 10.50;
How do you print only part of a string?
Explain what is the difference between a free-standing and a hosted environment?
Where can I get an ansi-compatible lint?
When should a far pointer be used?
Is c easy to learn?