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
any restrictions have on the number of 'return' statements that may be present in a function. a) no restriction b) only 2 return statements c) only 1 return statements d) none of the above
What should malloc(0) do? Return a null pointer or a pointer to 0 bytes?
How can you increase the size of a dynamically allocated array?
How to define structures? ·
What is the difference between int main and void main in c?
What is the use of ?: Operator?
How does #define work?
When should the register modifier be used? Does it really help?
What are integer variable, floating-point variable and character variable?
Explain low-order bytes.
What is the use of static variable in c?
a function gets called when the function name is followed by a a) semicolon (;) b) period(.) c) ! d) none of the above
1) write a program to generate 1st n fibonacci prime numbers using Nested if 2) write a program to generate twin prime numbers from m to n using nested if 3) write a program to check whether a given integer is a strong number or not using nested if 4) Write a program to generate prime factors of a given integer using nested if 5)write a program to generate prime numbers from m to n using nested if 6)write a program to generate perfect numbers from m to n using nested if 7)write a program to generate the pallindromes from m to n using neste if 8)write a program to generate armstrong numbers from m to n using nested if 9)write a program to generate strong numbers from m to n using nested if
What are conditional operators in C?
What does %d do?