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
Write a program to swap two numbers without using third variable?
What is wrong with this declaration?
what is the structure pointer?
how to create duplicate link list using C???
How can you draw circles in C?
Who is the main contributor in designing the c language after dennis ritchie?
What is a file descriptor in c?
In C programming, how do you insert quote characters (‘ and “) into the output screen?
What are the advantages of c language?
Place the #include statement must be written in the program?
any function have arguments one or more OR not . it is compulsary a) any function compulsary have one or more arguments b) any function did not have arguments. It is not compulsary c) it is optional it is not compulsary d) none of the above
Write a C program linear.c that creates a sequence of
processes with a given length. By
sequence it is meant that each created process has exactly
one child.
Let's look at some example outputs for the program.
Here the entire process sequence consists of process 18181:
Sara@dell:~/OSSS$ ./linear 1
Creating process sequence of length 1.
18181 begins the sequence.
An example for a sequence of length three:
Sara@dell:~/OSSS$ ./linear 3
Creating process sequence of length 3.
18233 begins the sequence.
18234 is child of 18233
18235 is child of 18234
........ this is coad .... BUt i could not compleate it .....:(
#include
Difference between macros and inline functions? Can a function be forced as inline?
Can true be a variable name in c?
Is c still used?