Operating System Solved MCQs computer science

By: Prof. Fazal Rehman Shamil

Solved MCQs on a General Purpose Tool in operating systems.

In the interpretive mode the perl program runs.
(A). False
(B). True
(E). None of these
Multiple Choice Question Answer: b
What do we use To test whether perl is in your PATH?
(A). perl -el
(B). perl -i
(C). perl -e
(D). perl -ed
(E). None of these
Multiple Choice Question Answer: c

Which function is used to delete the elements from the right of the array?
(A). queue
(B). push
(C). pop
(D). shift
(E). None of these
Multiple Choice Question Answer: c
perl is what of the grep, tr, sed and awk?
(A). subset
(B). child
(C). superset
(D). parent
(E). None of these
Multiple Choice Question Answer: c
In command line filename can be specified by using the perl.
(A). False
(B). True
(E). None of these
Multiple Choice Question Answer: b
What is used to loop in a list?
(A). for
(B). fordo
(C). foreach
(D). while
(E). None of these
Multiple Choice Question Answer: b
To test files with perl find command is used.
(A). False
(B). True
(E). None of these
Multiple Choice Question Answer: bss
with what extension, it is convenient to save perl program files?
(A). .gp
(B). .pl
(C). .awk
(D). .sh
(E). None of these
Multiple Choice Question Answer: b
Which function do we used to remove last character from a line?
(A). chop
(B). cut
(C). erase
(D). split
(E). None of these
Multiple Choice Question Answer: a
To alter an existing string the substr function is used.
(A). False
(B). True
(E). None of these
Multiple Choice Question Answer: b
To identify a word character the escape character used is_______
(A). \s
(B). \w
(C). \d
(D). \n
(E). None of these
Multiple Choice Question Answer: b
The perl variables don’t have any types and any initializations.
(A). False
(B). True
(E). None of these
Multiple Choice Question Answer: b
What is the most powerful filter?
(A). perl
(B). grep
(C). sed
(D). awk
(E). None of these
Multiple Choice Question Answer: a
To handle the substitutions in perl we use___________
(A). tr
(B). tr and s
(C). str
(D). s
(E). None of these
Multiple Choice Question Answer: b
Which of the following functions return the first occurrence of the character in the string?
(A). string
(B). length
(C). split
(D). index
(E). None of these
Multiple Choice Question Answer: d
Which function do we use for extracting a substring?
(A). string
(B). index
(C). length
(D). substr
(E). None of these
Multiple Choice Question Answer: d
which operator the perl uses to repeat a string?
(A). x
(B). .
(C). /
(D). \\
(E). None of these
Multiple Choice Question Answer: a
To display the length of a string, the perl uses what function?
(A). string
(B). length
(C). split
(D). len
(E). None of these
Multiple Choice Question Answer: b
To reverse a string, the perl uses which function?
(A). reverse
(B). rev
(C). split
(D). substr
(E). None of these
Multiple Choice Question Answer: a

When we use string for numeral computations, in what the perl converts it?
(A). number
(B). floating point number
(C). character
(D). boolean value
(E). None of these
Multiple Choice Question Answer: a
What is the value of undefined variable?
(A). garbage
(B). 1
(C). NULL
(D). 0
(E). None of these
Multiple Choice Question Answer: d
Concatenation operators are______________
(A). /
(B). _
(C). .
(D). \\
(E). None of these
Multiple Choice Question Answer: c

Use of for loop is supported by perl in following manner.
for($i=0;$i<3;$i++){ }
(A). True
(B). False
(E). None of these
Multiple Choice Question Answer: a
What is used to split the line or expression into fields?
(A). foreach
(B). for
(C). join
(D). split
(E). None of these
Multiple Choice Question Answer: d
What is referred to as default variable?
(A). $0
(B). $_-+*
(C). $!
(D). $1
(E). None of these
Multiple Choice Question Answer: b
To select current line number which operator can be used?
(A). $.
(B). $1
(C). $0
(D). $_
(E). None of these
Multiple Choice Question Answer: a
What is range operator?
(A). $.
(B). $1
(C). . .
(D). $_
(E). None of these
Multiple Choice Question Answer: c
First ten integer values to the array ‘a’ are assigned by command @x=(1. .10).
(A). False
(B). True
(E). None of these
Multiple Choice Question Answer: b
Last index of the array is signified by which prefix to the array name?
(A). $0
(B). $_
(C). #$
(D). $#
(E). None of these
Multiple Choice Question Answer: d
Which function is used for adding the elements to the left side of the array?
(A). pop
(B). unshift
(C). queue
(D). push
(E). None of these
Multiple Choice Question Answer: b
Which function is used for adding elements to the right side of the array?
(A). pop
(B). queue
(C). push
(D). unshift
(E). None of these
Multiple Choice Question Answer: c
perl -e ‘print “UNIX” x 10 . “\n” ;’
this displays____
(A). UNIX
(B). error message
(C). UNIX 10 times
(D). \n
(E). None of these
Multiple Choice Question Answer: c
Functionalities of push, pop, unshift and shift are combined by which function?
(A). add
(B). splice
(C). delete
(D). split
(E). None of these
Multiple Choice Question Answer: b
which function is used to join lists?
(A). join
(B). for
(C). split
(D). foreach
(E). None of these
Multiple Choice Question Answer: a
Which function is used to delete the elements from the left of the array?
(A). shift
(B). push
(C). queue
(D). pop
(E). None of these
Multiple Choice Question Answer: a

Prof. Fazal Rehman Shamil