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 your first name as an input to your program and add a screen shot here which displays either its palindrome or not?
Create a program in C that allows the user to prompt for the input of the author's last name, the publication year, and the publication city for the book. String input should accept spaces, since both names and cities (especially in publishing) may be multi-word. You also should abide by the rules of the Prgramming Recitation 1 with regards to error trapping. Turn in your .C file and your makefile. Get used to this: Exercises will have this tendency to be pieces of the recitiation. The hope is that you will get enough out of the exercises to be able to perform the work in the recitation.
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