Aim:-

To design an online simulator that checks whether a given input string (program snippet) is a single/multi-comment or not a comment.

Theory:-

Given a string, representing a program snippet, the task is to check if the given string is a single/multi-line comment or not a comment.

Types of Comment:

Check if at the first Index(i.e. index 0) the value is ‘/’ then follow below steps else print “It is not a comment”.

Input/Output Examples:-

Online Simulator:-

Click on this Link to go to the Online Simulator.

Discussion:-

We wrote the online simulator using C programming language and integrated it with the website designed using HTML, CSS, JavaScript. The simulator takes a string as input and checks whether it is a single/multi-line comment or not a comment.

Source of Error & Error Recovery:-

There can be two possible sources of error for this string in the program snippet: