C Programming Language
C Programming Language
2nd Edition
ISBN: 9780131103627
Author: Brian W. Kernighan, Dennis M. Ritchie, Dennis Ritchie
Publisher: Prentice Hall
bartleby

Concept explainers

Question
Book Icon
Chapter 1, Problem 23E
Program Plan Intro

Program Plan-

  • Initialize the header files and main() function.
  • Ask the user to enter the text and press the Ctrl+z to end the program.
  • To define the function getline(char[], int) to store the line into array and calculate the length of the line.
  • To read the line using while loop and check if there are any comments in the line, if present remove them.
  • Finally prints the lines without comments.

Summary Introduction- The program takes the text line and prints the line after removing all the comments from the line.

Program Description- The purpose of the program is to take the take the text line and remove the comments using the fullwoing function-

getline(char[], int).

Blurred answer
Students have asked these similar questions
Take input a string from user and reverse it without using any library functions. Print the reversed string in output. Code in C++
Palindrome is a word that reads the same backwards and forwards e.g. MADAM, POP, TAT etc. are palindromes. Write a C++ program that checks whether a given string is a Palindrome or not using an appropriate data structure. Enter Ghazi as an input to your program and add a screen shot here which displays either its palindrome or not?
Write a c++ program that asks the user to enter a sentence and two words. The task is to replace the first word within the sentence with the second word and print the new string. Otherwise, print an error message that the word is not found. example: Write a program that asks the user to enter a sentence and two words. user programmer   Write a program that asks the programmer to enter a sentence and two words.
Knowledge Booster
Background pattern image
Computer Science
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr