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.

  1. White space consists of blanks, tabs and newlines.

Tasks

  1. Implement code for whitespace removal i.e.blanks, tabs and newlines
  2. Write code for removing comments from the source code
    1. Single line comments
    2. Multi-line comments
  3. 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

1 Expert Approved Answer
Step: 1 Unlock

This code can be used to remove the white space in ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related General Management Questions!