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
please explain clearly about execution of c program in detail,in which stage are the printf sacnf getting into exeecutable code
A routine usually part of the operation system that loads a program into memory prior to execution a) linker b) loader c) preprocessor d) compiler
How can I do serial ("comm") port I/O?
What is identifiers in c with examples?
What is the difference between array and pointer?
How is actual parameter different from the formal parameter?
What does %d do?
What are structures and unions? State differencves between them.
What is the benefit of using #define to declare a constant?
what is a function method?give example?
Is there any demerits of using pointer?
What is the difference between #include and #include 'file' ?
When should the const modifier be used?
c language interview questions & answer
Write a program to identify if a given binary tree is balanced or not.