

MCQOPTIONS
Saved Bookmarks
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 |
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
|
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.
|
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 " |
A. | Array ( [3] => blue [4] => blue) |
B. | Array ( [4] => blue [5] => blue [6] => blue) |
C. | Array ( [3] => blue [4] => blue [5] => blue [6] => blue ) |
D. | Array ( [3] => blue [4] => blue [5] => blue [6] => 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] => red [1] => green) |
B. | Array ( [0] => blue [1] => yellow [2] => red [3] => green ) |
C. | Array ( [0] => red [1] => green [2] => blue [3] => yellow ) |
D. | Array ( [0] => blue [1] => yellow ) |
Answer» D. Array ( [0] => blue [1] => 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] => red [1] => green ) |
B. | Array ( [0] => green [1] => blue ) |
C. | Array ( [0] => red [1] => blue ) |
D. | Array ( [0] => blue [1] => blue ) |
Answer» B. Array ( [0] => green [1] => 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] => apple [0] => mango [2] => peach [3] => pear ) |
B. | Array ( [0] => apple [1] => mango [2] => peach [3] => pear ) |
C. | Error |
D. | Array ( [1] => apple [0] => mango [3] => peach [2] => pear ) |
Answer» B. Array ( [0] => apple [1] => mango [2] => peach [3] => 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] => picture1.JPG [1] => Picture10.jpg [2] => picture2.jpg [3] => picture20.jpg ) |
B. | Array ( [0] => picture1.JPG [1] => picture2.jpg [2] => Picture10.jpg [3] => picture20.jpg ) |
C. | Array ( [0] => Picture10.jpg [1] => picture1.JPG [2] => picture2.jpg [3] => picture20.jpg ) |
D. | Array ( [0] => Picture10.jpg [1] => picture1.JPG [2] => picture20.jpg [3] => picture2.jpg ) |
Answer» D. Array ( [0] => Picture10.jpg [1] => picture1.JPG [2] => picture20.jpg [3] => 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] => A [1] => J [2] => Q [3] => K [4] => 2 [5] => 3 [6] => 4 [7] => 5 [8] => 6 [9] => 7 [10] => 8 [11] => 9 [12] => 10 ) |
B. | Array ( [0] => A [1] => 2 [2] => J [3] => 3 [4] => Q [5] => 4 [6] => K [7] => 5 [8] => 6 [9] => 7 [10] => 8 [11] => 9 [12] => 10 ) |
C. | Error |
D. | Array ( [0] => 2 [1] => 3 [2] => 4 [3] => 5 [4] => 6 [5] => 7 [6] => 8 [7] => 9 [8] => 10 [9] => A [10] => J [11] => Q [12] => K ) |
Answer» B. Array ( [0] => A [1] => 2 [2] => J [3] => 3 [4] => Q [5] => 4 [6] => K [7] => 5 [8] => 6 [9] => 7 [10] => 8 [11] => 9 [12] => 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] => peach ) |
B. | Array ( [0] => apple [1] => mango [2] => peach ) |
C. | Array ( [0] => apple [1] => mango ) |
D. | Array ( [0] => peach [1] => pear [2] => 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] => apple [1] => mango [2] => peach ) |
C. | Array ( [0] => apple [1] => mango ) |
D. | Array ( [0] => pear [1] => orange ) |
Answer» D. Array ( [0] => pear [1] => 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] => KA [1] => LA [2] => CA [3] => MA [4] => TA [5] => IA [6] => GA ) |
B. | Array ( [0] => KA [2] => CA [4] => TA ) |
C. | Array ( [1] => IA [3] => GA ) |
D. | Array ( [1] => LA [3] => MA ) |
Answer» C. Array ( [1] => IA [3] => 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] => 21 [Ron] => 23 [Malfoy] => 21 ) |
B. | Array ( [HARRY] => 21 [RON] => 23 [MALFOY] => 21 ) |
C. | Array ( [HARRY] => 21 [RON] => 23 ) |
D. | Array ( [Harry] => 21 [Ron] => 23 ) |
Answer» D. Array ( [Harry] => 21 [Ron] => 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] => red [green] => green [blue] => blue [yellow] => yellow ) |
B. | Array ( [a] => a [b] => b [c] => c [d] => d ) |
C. | Array ( [red] => a [green] => b [blue] => c [yellow] => d ) |
D. | Array ( [a] => red [b] => green [c] => blue [d] => yellow ) |
Answer» D. Array ( [a] => red [b] => green [c] => blue [d] => 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] => red [b] => green [c] => blue ) |
B. | Array ( [a] => red [b] => green [c] => blue [d] => yellow ) |
C. | Array ( [e] => red [f] => green [g] => blue ) |
D. | Array ( [a] => red [b] => green [c] => blue [d] => yellow [e] => red [f] => green [g] => blue ) |
Answer» B. Array ( [a] => red [b] => green [c] => blue [d] => 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] => Mumbai [0] => Beijing ) |
B. | Array ( [0] => NYC [1] => London ) |
C. | Array ( [1] => NYC [0] => London ) |
D. | Array ( [0] => Mumbai [1] => 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] => 0 [1] => 1 [2] => 2 [3] => 3 [4] => 4 [5] => 5 ) |
B. | Array ( [0] => 0 [1] => 0 [2] => 0 [3] => 0 [4] => 0 [5] => 0 ) |
C. | Array ( [0] => 5 [1] => 5 [2] => 5 [3] => 5 [4] => 5 [5] => 5 ) |
D. | Array ( [0] => 0 [5] => 5 ) |
Answer» B. Array ( [0] => 0 [1] => 0 [2] => 0 [3] => 0 [4] => 0 [5] => 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] => red [1] => green [2] => blue [3] => yellow ) |
B. | Array ( [0] => blue [1] => yellow [2] => red [3] => green ) |
C. | Array ( [0] => red [1] => green ) |
D. | Array ( [0] => blue [1] => yellow ) |
Answer» B. Array ( [0] => blue [1] => yellow [2] => red [3] => 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] => 35 [Ben] => 37 [Joe] => 43 ) |
B. | Array ( [peter] => 35 [ben] => 37 [joe] => 43 ) |
C. | Array ( [PETER] => 35 [BEN] => 37 [JOE] => 43 ) |
D. | Array ( [PeTeR] => 35 [BeN] => 37 [Joe] => 43 ) |
Answer» D. Array ( [PeTeR] => 35 [BeN] => 37 [Joe] => 43 ) | |