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 adt in c programming?
How many types of arrays are there in c?
If a variable is a pointer to a structure, then which operator is used to access data members of the structure through the pointer variable?
What is the use of parallelize in spark?
What are register variables? What are the advantage of using register variables?
What does void main return?
There is a practice in coding to keep some code blocks in comment symbols than delete it when debugging. How this affect when debugging?
Explain the difference between malloc() and calloc() in c?
What is an lvalue in c?
How can I call fortran?
Does c have class?
What are header files and what are its uses in C programming?
How many levels of pointers can you have?
What is a static function in c?
An expression to whose value an operater is applied a) operand b) variable c) constant d) all of the above