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
Explain how does flowchart help in writing a program?
Explain the use of 'auto' keyword in c programming?
How can you be sure that a program follows the ANSI C standard?
What is structure and union in c?
What is uint8 in c?
Write a program to display all the prime nos from 1 to 1000000, your code should not take time more than a minute to display all the nos.
What is string function c?
Explain what are header files and explain what are its uses in c programming?
Write a program of advanced Fibonacci series.
what is use of malloc and calloc?
struct screen_pos{ int row, col } ;move_right(cursor)struct screen_pos *cursor;{ cursor.col++; } /* This statementhas a syntax error */What is the correct statement a) cursor.col = cursor.col + 1; b) col.cursor++; c) *cursor.col++; d) pointer
The program will first compute the tax you owe based on your income. User is prompted to enter income. Program will compute the total amount of tax owed based on the following: Income Tax 0 - $45,000 = 0.15 x income $45,001 - $90,000 = 6750 + 0.20 x (income – 45000) $90,001 - $140,000 = 15750 + 0.26 x (income – 90000) $140,001 - $200,000 = 28750 + 0.29 x (income – 140000) Greater than $200,000 = 46150 + 0.33 x (income – 200000) Dollar amounts should be in dollars and cents (float point numbers with two decimals shown). Tax is displayed on the screen.
How do you list files in a directory?
What are the different file extensions involved when programming in C?
What is a dynamic array in c?