Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Ex 4 . 1 0 , 1 1 : Replace C 9 9 comments The original 1 9 8 9 ANSI / 1 9 9
Ex: Replace C comments
The original ANSI ISO C standard ANSI C C only permits style comments:
This is a comment
This is
a multiline comment
The ISO standard C provides lineoriented comments starting with a combination:
Task
Starting with the program fortcomm.c shown in Figure on page also found in "Reading
data with loops" write a program that replaces each cstyle comment in the input text by an
equivalent ANSI C comment.
That is each pair that commences a comment should be replaced by and then a
combination should be inserted immedlately prior to the next newline character.
Sample output
The program should not prompt for input. Any input given to it should be outputted with Cstyle
comments being replaced with ANSI C comments.
My useful program
#include stdioh
int main Our main function
printfHello world!
print hello
done, phew!
return
bash$ program input.c
My useful program
#include
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started