Explore topic-wise MCQs in General Awareness.

This section includes 1698 Mcqs, each offering curated multiple-choice questions to sharpen your General Awareness knowledge and support exam preparation. Choose a topic below to get started.

151.

Statement in BASIC language 150 IF A1=A2 THEN ComparisonINR = EQUAL is an example of

A. If then statement
B. If else statement
C. Else one statement
D. Then else statement
Answer» B. If else statement
152.

Task of the lexical analysis phase is

A. To parse the source program into basic elements or tockens of the language
B. To build a literal literal table and an identifier table
C. To build a uniform symbol table
D. All of these
Answer» A. To parse the source program into basic elements or tockens of the language
153.

Which is a permanent database in the general model of compiler

A. Literal table
B. Identifier table
C. Terminal table
D. Source code
Answer» D. Source code
154.

Which table is a permanent databases that has an entry for each terminal symbol ?

A. Terminal table
B. Literal table
C. Identifier table
D. Reductions
Answer» B. Literal table
155.

The output of lexical analyser is

A. A set of regular expressions
B. Syntax tree
C. Set of tokens
D. Strings of characters
Answer» D. Strings of characters
156.

Machine independent phase of the compiler is

A. Syntax analysis
B. Lexical analysis
C. Intermediate code generation
D. All of these
Answer» E.
157.

Which of the following is used for grouping of characteristics into tokens ?

A. Parser
B. Code optimization
C. Code generator
D. Lexical analyser
Answer» E.
158.

which of the following grammer is LR(1) ?

a)A->aAa
A->bAb
A->a
A->b

b)A->aAa
A->aAb
A->c

c)A->A+A
A->a

d)both a and b

A. A
B. B
C. C
D. D
Answer» C. C
159.

Which of the following parser is the most powerful ?

A. Operator precedence
B. Canonical LR
C. LALR
D. SLR
Answer» C. LALR
160.

A parser with valid prefix property is advantageous because it

A. Detects error as soon as possible
B. Detects errors as and when they occur
C. Limits the amount of erroneous output passed to the next phase
D. All of these
Answer» D. All of these
161.

Back-patching is useful for handling

A. Conditional jumps
B. Unconditional jumps
C. Backward reference
D. Forward references
Answer» E.
162.

Access time of the symbol table will be logarithmic,if it is implemented by

A. Linear list
B. Search tree
C. Hash table
D. Self-organizing list
Answer» C. Hash table
163.

A shift reduce parser carries out the actions specified within braces immediately after reducing,with
the corresponding rule of the grammar

s->xxW{print 1 }
s->y{print 2 }
w->sz{print 3 }

what is the translation of xxxxyzz ?

A. 11231
B. 11233
C. 23131
D. 233321
Answer» D. 233321
164.

which of the following cannot be used an an intermediate code form ?

A. Post fix notation
B. Three address codes
C. Syntax trees
D. Quadraples
Answer» E.
165.

It has encoded within it information on the possible sequences of characters that can be contained within any of the tokens it handles.
Above motioned function is performed by?

A. Scanner
B. Parser
C. Syntactic Analyser
D. All of the mentioned
Answer» B. Parser
166.

Which one is a lexer Generator ?

A. ANTLR
B. DRASTAR
C. FLEX
D. All of the mentioned
Answer» E.
167.

Which of the lexical analyser can handle Unicode ?

A. Java CC
B. JFLex
C. Quex
D. All of the mentioned
Answer» E.
168.

Which phase of compiler is Syntax Analysis ?

A. First
B. Second
C. Third
D. None of the mentioned
Answer» C. Third
169.

Syntax Analyser also known as

A. Hierarchical Analysis
B. Hierarchical Parsing
C. None of the mentioned
D. Both of the mentioned
Answer» E.
170.

syntax analyzer or parser takes the input from a ______________.

A. Lexical analyser
B. Syntactic Analyser
C. Semantic Analyser
D. None of the mentioned
Answer» B. Syntactic Analyser
171.

Output file of Lex is _____ , if the input file is Myfile.

A. Myfile.e
B. Myfile.yy.c
C. Myfile.lex
D. Myfile.obj
Answer» C. Myfile.lex
172.

If E be a shifting operation applied to a function f, such that E(f) = f (x + ), then

A. E ( f + g )= E (f+g )
B. E ( f + g )= E (f + g)
C. E ( f+ g) = E(f) + E (g)
D. E ( f + g )=. ( + )+ E (f + g)
Answer» D. E ( f + g )=. ( + )+ E (f + g)
173.

What will be the output of the following PHP code?
 <?php $a1 = array_fill(3, 4, "blue"); $b1 = array_fill(0, 1, "red"); print_r($a1); echo "
"; print_r($b1); ?>

A. Array ( [3] =&gt; blue [4] =&gt; blue)
B. Array ( [4] =&gt; blue [5] =&gt; blue [6] =&gt; blue)
C. Array ( [3] =&gt; blue [4] =&gt; blue [5] =&gt; blue [6] =&gt; blue )
D. Array ( [3] =&gt; blue [4] =&gt; blue [5] =&gt; blue [6] =&gt; blue )
Answer» E.
174.

What will be the output of the following PHP code?
 <?php $a1 = array("red", "green"); $a2 = array("blue", "yellow"); print_r(array_merge($a1, $a2)); ?>  

A. Array ( [0] =&gt; red [1] =&gt; green)
B. Array ( [0] =&gt; blue [1] =&gt; yellow [2] =&gt; red [3] =&gt; green )
C. Array ( [0] =&gt; red [1] =&gt; green [2] =&gt; blue [3] =&gt; yellow )
D. Array ( [0] =&gt; blue [1] =&gt; yellow )
Answer» D. Array ( [0] =&gt; blue [1] =&gt; yellow )
175.

What will be the output of the following PHP code?
 <?php $a = array("a"=>"red", "b"=>"green", "c"=>"blue"); echo array_shift($a); print_r ($a); ?>  

A. Green
B. Red
C. Blue
D. None of the mentioned
Answer» C. Blue
176.

What will be the output of the following PHP code?
 <?php $a = array("red", "green", "blue"); array_pop($a); print_r($a); ?>  

A. Array ( [0] =&gt; red [1] =&gt; green )
B. Array ( [0] =&gt; green [1] =&gt; blue )
C. Array ( [0] =&gt; red [1] =&gt; blue )
D. Array ( [0] =&gt; blue [1] =&gt; blue )
Answer» B. Array ( [0] =&gt; green [1] =&gt; blue )
177.

What will be the output of the following PHP code?
 <?php $fruits = array ("mango", "apple", "pear", "peach"); $fruits = array_flip($fruits); echo ($fruits[0]); ?>  

A. Mango
B. Error
C. Peach
D. 0
Answer» C. Peach
178.

What will be the output of the following PHP code?
 <?php $fruits = array ("mango", "apple", "peach", "pear"); $fruits = asort ($fruits); printr ($fruits); ?>  

A. Array ( [1] =&gt; apple [0] =&gt; mango [2] =&gt; peach [3] =&gt; pear )
B. Array ( [0] =&gt; apple [1] =&gt; mango [2] =&gt; peach [3] =&gt; pear )
C. Error
D. Array ( [1] =&gt; apple [0] =&gt; mango [3] =&gt; peach [2] =&gt; pear )
Answer» B. Array ( [0] =&gt; apple [1] =&gt; mango [2] =&gt; peach [3] =&gt; pear )
179.

What will be the output of the following PHP code?
 <?php $arr = array ("picture1.JPG", "picture2.jpg", "Picture10.jpg", "picture20.jpg"); sort($arr); print_r($arr); ?>  

A. Array ( [0] =&gt; picture1.JPG [1] =&gt; Picture10.jpg [2] =&gt; picture2.jpg [3] =&gt; picture20.jpg )
B. Array ( [0] =&gt; picture1.JPG [1] =&gt; picture2.jpg [2] =&gt; Picture10.jpg [3] =&gt; picture20.jpg )
C. Array ( [0] =&gt; Picture10.jpg [1] =&gt; picture1.JPG [2] =&gt; picture2.jpg [3] =&gt; picture20.jpg )
D. Array ( [0] =&gt; Picture10.jpg [1] =&gt; picture1.JPG [2] =&gt; picture20.jpg [3] =&gt; picture2.jpg )
Answer» D. Array ( [0] =&gt; Picture10.jpg [1] =&gt; picture1.JPG [2] =&gt; picture20.jpg [3] =&gt; picture2.jpg )
180.

What will be the output of the following PHP code?
 <?php $face = array ("A", "J", "Q", "K"); $number = array ("2","3","4", "5", "6", "7", "8", "9", "10"); $cards = array_merge ($face, $number); print_r ($cards); ?>  

A. Array ( [0] =&gt; A [1] =&gt; J [2] =&gt; Q [3] =&gt; K [4] =&gt; 2 [5] =&gt; 3 [6] =&gt; 4 [7] =&gt; 5 [8] =&gt; 6 [9] =&gt; 7 [10] =&gt; 8 [11] =&gt; 9 [12] =&gt; 10 )
B. Array ( [0] =&gt; A [1] =&gt; 2 [2] =&gt; J [3] =&gt; 3 [4] =&gt; Q [5] =&gt; 4 [6] =&gt; K [7] =&gt; 5 [8] =&gt; 6 [9] =&gt; 7 [10] =&gt; 8 [11] =&gt; 9 [12] =&gt; 10 )
C. Error
D. Array ( [0] =&gt; 2 [1] =&gt; 3 [2] =&gt; 4 [3] =&gt; 5 [4] =&gt; 6 [5] =&gt; 7 [6] =&gt; 8 [7] =&gt; 9 [8] =&gt; 10 [9] =&gt; A [10] =&gt; J [11] =&gt; Q [12] =&gt; K )
Answer» B. Array ( [0] =&gt; A [1] =&gt; 2 [2] =&gt; J [3] =&gt; 3 [4] =&gt; Q [5] =&gt; 4 [6] =&gt; K [7] =&gt; 5 [8] =&gt; 6 [9] =&gt; 7 [10] =&gt; 8 [11] =&gt; 9 [12] =&gt; 10 )
181.

What will be the output of the following PHP code?
 <?php $fruits = array ("apple", "mango", "peach", "pear", "orange"); $subset = array_slice ($fruits, 2); print_r ($subset); ?>  

A. Array ( [0] =&gt; peach )
B. Array ( [0] =&gt; apple [1] =&gt; mango [2] =&gt; peach )
C. Array ( [0] =&gt; apple [1] =&gt; mango )
D. Array ( [0] =&gt; peach [1] =&gt; pear [2] =&gt; orange )
Answer» E.
182.

What will be the output of the following PHP code?
 <?php $fruits = array ("apple", "mango", "peach", "pear", "orange"); $subset = array_splice ($fruits, 2); print_r ($fruits); ?>  

A. Error
B. Array ( [0] =&gt; apple [1] =&gt; mango [2] =&gt; peach )
C. Array ( [0] =&gt; apple [1] =&gt; mango )
D. Array ( [0] =&gt; pear [1] =&gt; orange )
Answer» D. Array ( [0] =&gt; pear [1] =&gt; orange )
183.

What will be the output of the following PHP code?
 <?php $number = array ("4", "hello", 2); echo (array_sum ($number)); ?>  

A. 4hello2
B. 4
C. 2
D. 6
Answer» E.
184.

What will be the output of the following PHP code?
 <?php $array1 = array ("KA", "LA", "CA", "MA", "TA"); $array2 = array ("KA", "IA", "CA", "GA", "TA"); $inter = array_intersect ($array1, $array2); print_r ($inter); ?>  

A. Array ( [0] =&gt; KA [1] =&gt; LA [2] =&gt; CA [3] =&gt; MA [4] =&gt; TA [5] =&gt; IA [6] =&gt; GA )
B. Array ( [0] =&gt; KA [2] =&gt; CA [4] =&gt; TA )
C. Array ( [1] =&gt; IA [3] =&gt; GA )
D. Array ( [1] =&gt; LA [3] =&gt; MA )
Answer» C. Array ( [1] =&gt; IA [3] =&gt; GA )
185.

Which one of the following functions can be used to compress a string?

A. Zip_compress()
B. Zip()
C. Compress()
D. Gzcompress()
Answer» E.
186.

What will be the output of the following PHP code?
 <?php echo "chr(52)"; ?>  

A. 106
B. 103
C. 104
D. 209
Answer» D. 209
187.

What will be the output of the following PHP code?
 <?php echo ucwords("i love my country"); ?>  

A. I love my country
B. I love my Country
C. I love my Country
D. I Love My Country
Answer» E.
188.

What will be the output of the following PHP code?
 <?php echo lcfirst("welcome to America"); ?>  

A. Welcome to America
B. Welcome to America
C. Welcome to America
D. Welcome to America
Answer» B. Welcome to America
189.

Pi is aan

A. Trigonometry function
B. Exponential function
C. Base conversion function
D. None of them
Answer» B. Exponential function
190.

$multi_array [1] [2] [3] [4] = I am working on PHP ; will create

A. One dimensional array
B. 5 dimensional array
C. 4 dimensional array
D. None of them
Answer» D. None of them
191.

What will be the output of the following PHP code ?
  <?php $age = array("Harry" => "21", "Ron" => "23","Malfoy" => "21"); array_change_key_case($age, CASE_UPPER); array_pop($age); print_r($age); ?>  

A. Array ( [Harry] =&gt; 21 [Ron] =&gt; 23 [Malfoy] =&gt; 21 )
B. Array ( [HARRY] =&gt; 21 [RON] =&gt; 23 [MALFOY] =&gt; 21 )
C. Array ( [HARRY] =&gt; 21 [RON] =&gt; 23 )
D. Array ( [Harry] =&gt; 21 [Ron] =&gt; 23 )
Answer» D. Array ( [Harry] =&gt; 21 [Ron] =&gt; 23 )
192.

What will be the output of the following PHP code ?
  <?php $a1 = array("a" => "red", "b" => "green", "c" => "blue", "d" => "yellow"); $result = array_flip($a1); print_r($result); ?>  

A. Array ( [red] =&gt; red [green] =&gt; green [blue] =&gt; blue [yellow] =&gt; yellow )
B. Array ( [a] =&gt; a [b] =&gt; b [c] =&gt; c [d] =&gt; d )
C. Array ( [red] =&gt; a [green] =&gt; b [blue] =&gt; c [yellow] =&gt; d )
D. Array ( [a] =&gt; red [b] =&gt; green [c] =&gt; blue [d] =&gt; yellow )
Answer» D. Array ( [a] =&gt; red [b] =&gt; green [c] =&gt; blue [d] =&gt; yellow )
193.

What will be the output of the following PHP code ?
  <?php $a1 = array("a" => "red", "b" => "green", "c" => "blue", "d" => "yellow"); $a2 = array("e" => "red","f" => "green", "g" => "blue"); $result = array_intersect($a1, $a2); print_r($result); ?>  

A. Array ( [a] =&gt; red [b] =&gt; green [c] =&gt; blue )
B. Array ( [a] =&gt; red [b] =&gt; green [c] =&gt; blue [d] =&gt; yellow )
C. Array ( [e] =&gt; red [f] =&gt; green [g] =&gt; blue )
D. Array ( [a] =&gt; red [b] =&gt; green [c] =&gt; blue [d] =&gt; yellow [e] =&gt; red [f] =&gt; green [g] =&gt; blue )
Answer» B. Array ( [a] =&gt; red [b] =&gt; green [c] =&gt; blue [d] =&gt; yellow )
194.

What will be the output of the following PHP code ?
  <?php $a = array(12, 5, 2); echo(array_product($a)); ?>  

A. 024
B. 120
C. 010
D. 060
Answer» C. 010
195.

What will be the output of the following PHP code ?
 <?php $a = array("a" => "Jaguar", "b" => "Land Rover", "c" => "Audi", "d" => "Maseratti"); echo array_search("Audi", $a); ?>  

A. a
B. b
C. d
D. d
Answer» D. d
196.

What will be the output of the following PHP code ?
  <?php $city_west = array("NYC", "London"); $city_east = array("Mumbai", "Beijing"); print_r(array_replace($city_west, $city_east)); ?>  

A. Array ( [1] =&gt; Mumbai [0] =&gt; Beijing )
B. Array ( [0] =&gt; NYC [1] =&gt; London )
C. Array ( [1] =&gt; NYC [0] =&gt; London )
D. Array ( [0] =&gt; Mumbai [1] =&gt; Beijing )
Answer» E.
197.

What will be the output of the following PHP code ?
  <?php $people = array("Peter", "Susan", "Edmund", "Lucy"); echo pos($people); ?>  

A. Lucy
B. Peter
C. Susan
D. Edmund
Answer» C. Susan
198.

What will be the output of the following PHP code ?
  <?php $number = range(0, 5); print_r ($number); ?>  

A. Array ( [0] =&gt; 0 [1] =&gt; 1 [2] =&gt; 2 [3] =&gt; 3 [4] =&gt; 4 [5] =&gt; 5 )
B. Array ( [0] =&gt; 0 [1] =&gt; 0 [2] =&gt; 0 [3] =&gt; 0 [4] =&gt; 0 [5] =&gt; 0 )
C. Array ( [0] =&gt; 5 [1] =&gt; 5 [2] =&gt; 5 [3] =&gt; 5 [4] =&gt; 5 [5] =&gt; 5 )
D. Array ( [0] =&gt; 0 [5] =&gt; 5 )
Answer» B. Array ( [0] =&gt; 0 [1] =&gt; 0 [2] =&gt; 0 [3] =&gt; 0 [4] =&gt; 0 [5] =&gt; 0 )
199.

What will be the output of the following PHP code ?
  <?php $array = array("red", "green"); array_push($array, "blue", "yellow"); print_r($array); ?>  

A. Array ( [0] =&gt; red [1] =&gt; green [2] =&gt; blue [3] =&gt; yellow )
B. Array ( [0] =&gt; blue [1] =&gt; yellow [2] =&gt; red [3] =&gt; green )
C. Array ( [0] =&gt; red [1] =&gt; green )
D. Array ( [0] =&gt; blue [1] =&gt; yellow )
Answer» B. Array ( [0] =&gt; blue [1] =&gt; yellow [2] =&gt; red [3] =&gt; green )
200.

What will be the output of the following PHP code?
 <?php $age = array("Peter"=>"35", "Ben"=>"37", "Joe"=>"43"); print_r(array_change_key_case($age, CASE_UPPER)); ?>  

A. Array ( [Peter] =&gt; 35 [Ben] =&gt; 37 [Joe] =&gt; 43 )
B. Array ( [peter] =&gt; 35 [ben] =&gt; 37 [joe] =&gt; 43 )
C. Array ( [PETER] =&gt; 35 [BEN] =&gt; 37 [JOE] =&gt; 43 )
D. Array ( [PeTeR] =&gt; 35 [BeN] =&gt; 37 [Joe] =&gt; 43 )
Answer» D. Array ( [PeTeR] =&gt; 35 [BeN] =&gt; 37 [Joe] =&gt; 43 )