Theory of Computation MCQ (Multiple Choice Questions) - SchoolingAxis

Theory of Computation MCQ (Multiple Choice Questions)

 1. Which of the following does not support regular expressions?

a. sed

b. awk

c. emacs

d. None of the mentioned


Ans- d. None of the mentioned


2. What does the following segment of code does? grep -i man heroes.txt

a. manually opens a file called heroes.txt

b. manages heroes.txt

c. search for "man" in the file "heroes.txt"

d. none of the mentioned


Ans- c. search for "man" in the file "heroes.txt"


3. Which of the following options support the given statement? Statement: A regular expression could be a fixed word or describe something like more general.

a. This flexibility makes Regular expression invaluable.

b. This flexibility makes the Regular expression unvaluable.

c. Both (a) and (b)

d. None of the mentioned


Ans- a. This flexibility makes Regular expression invaluable.


4. What does grep do in UNIX?

a. It is an editor in UNIX

b. It searches for text patterns

c. Both (a) and (b)

d. None of the mentioned


Ans- b. It searches for text patterns


5. For the given syntax of sed, which among the following is not a correct option? General syntax of sed: /pattern/action

a. / are used as delimiters

b. pattern refers to a regular expression

c. pattern refers to the string to be matched

d. action refers to the command


Ans- c. pattern refers to the string to be matched


6. What is the significance of $ used in regular expression in UNIX?

a. Matches the beginning of the line

b. Matches the end of lines

c. Matches any single character

d. None of the mentioned


Ans- b. Matches the end of lines


7. Which among the following is not a UNIX command for regular expressions?

a. ed

b. sed

c. vi

d. None of the mentioned


Ans- d. None of the mentioned


8. Conversion of a regular expression into its corresponding NFA :

a. Thompson's Construction Algorithm

b. Powerset Construction

c. Kleene's algorithm

d. None of the mentioned


Ans- a. Thompson's Construction Algorithm

Previous Post Next Post