Question: Comments are enclosed in curly brackets {. . .}. Comments cannot be nested, however multiline comments are allowed. White space consists of blanks, tabs and
Comments are enclosed in curly brackets {. . .}. Comments cannot be nested, however multiline comments are allowed.
- White space consists of blanks, tabs and newlines.
Tasks
- Implement code for whitespace removal i.e.blanks, tabs and newlines
- Write code for removing comments from the source code
- Single line comments
- Multi-line comments
- Test your implementation using the sample “factorial” program writtenin TINY below.
Factorial Program:
//A program in TINY to compute factorial of a positive integer number will be written as //follows.
{
Factorial – Sample Program in TINY
}
read x; { input an integer }
if 0 < x then
fact := 1;
repeat
fact := fact * x;
x := x – 1;
until x = 0;
write fact;
end
solve complete and also show c++ code with screenshot
Step by Step Solution
3.42 Rating (158 Votes )
There are 3 Steps involved in it
This code can be used to remove the white space in ... View full answer
Get step-by-step solutions from verified subject matter experts
