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
with c++ use loob while Write a program to print the square and the cube of a series of numbers (1,2,3..5), but it displays the output in a table of three columns. The first column presents the numbers; the second column presents the square of the numbers while the third column presents the cubic of the same number.
1. Write a c program that accepts a string from the user and outputs the length ( do not use any buit-in functions ) (Hint you may use while loop – while the character read is not equal to ‘\0’ increment the count. ) 2. Using the code above. Add additional codes that will copy the characters in reverse order (Note: Write comments that explain what each main section of the code is   accomplishing and how)
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?
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