Computer Knowledge
Programming Languages and Compilers
2,284 Questions
Programming languages and compilers involve the rules, syntax, and semantics used to write and execute software programs. Key areas include scripting languages, object oriented concepts, and parsing algorithms like top down parsers. Practice these computer science questions to build proficiency for technical and computer knowledge exams.
Object oriented languagesScripting languagesCompilers and parsersProgramming syntax
Programming Languages and Compilers Questions
C
Correct answer
Explanation
Option 3 is the correct answer.
A
Correct answer
Explanation
Option 1 is the correct answer.
-
Operating system
-
Compiler
-
Text editor
-
Debugger
-
PDF reader
B
Correct answer
Explanation
A compiler is a system level program that translates a program written in a high level language to a machine language.
-
uses alphabetic codes in place of binary numbers used in machine language
-
is the easiest language to write programs
-
need not be translated into machine language
-
None of these
A
Correct answer
Explanation
Assembly languageĀ uses alphabetic codes in place of binary numbers used in machine language.
A
Correct answer
Explanation
Java is a modern, high-level, object-oriented programming language, whereas Algol, Cobol, and C are older languages.
-
is the language in which programs were first written
-
is the only language understood by the computer
-
differs from one type of computer to another
-
All of these
D
Correct answer
Explanation
Machine language is the low-level binary code that computers execute directly; it is hardware-specific and was the first language used for programming.
-
CLI provides the runtime specific code format and specification.
-
It translates the native code to be executable by a virtual machine.
-
CIL is an object-oriented assembly language.
-
The source code is CLI's equivalent to assembly language for a CPU.
-
All of these
B
Correct answer
Explanation
A C++ structure (struct) is a user-defined data type that can group variables of different types together, not just the same type.
-
array.concat()
-
array.join()
-
array.sort()
-
array.shift()
-
array.reverse()
D
Correct answer
Explanation
This method of JavaScript array removes and returns an element from the beginning of an array.
-
a set of regular expressions
-
syntax tree
-
a set of tokens
-
a string of characters
C
Correct answer
Explanation
The lexical analyzer (or scanner) reads the source code as a stream of characters and groups them into meaningful sequences called tokens.
-
incremental compiler
-
reconfigurable compiler
-
dynamic compiler
-
selective compiler
A
Correct answer
Explanation
An incremental compiler is designed to recompile only the parts of the source code that have been modified, which saves time during the development cycle.
-
Syntax Analysis
-
Code Generation
-
Lexical Analysis
-
Intermediate Code Generation
A
Correct answer
Explanation
Syntax analysis (parsing) deals with the structure of the language defined by a grammar, which is independent of the specific machine architecture on which the code will run.
-
second pass
-
first pass
-
zeroth pass
-
none of the above
A
Correct answer
Explanation
In a two-pass assembler, the first pass is used to build the symbol table, while the second pass uses the symbol table to generate the actual machine code (object code).
-
It is a machine language.
-
It is an assembly language.
-
It is a high-level language.
-
All of the above
-
syntax errors
-
semantic errors
-
logical errors
-
internal errors
A
Correct answer
Explanation
Compilers are designed to detect syntax errors, which are violations of the language's grammatical rules. Semantic and logical errors are often harder to detect at compile time.