Comments are enclosed in curly brackets {. . .}. Comments cannot be nested, however multiline comments are
Fantastic news! We've Found the answer you've been seeking!
Question:
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
Posted Date: