Computer Knowledge
Programming Languages and Compilers
1,170 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
-
interpretor
-
compiler
-
assembler
-
comparator
-
None of these
C
Correct answer
Explanation
Assembler is a computer program that converts assembly language to machine language.
-
DML
-
DDL
-
Assembly language
-
Low level language
-
High level language
B
Correct answer
Explanation
This language is used in SQL to define the structure of the table.
A
Correct answer
Explanation
Lex is a well-known tool used to generate lexical analyzers (scanners) for various programming languages. It reads specification files and produces C code for lexical analysis. Yaac, EQN, and TeX serve different purposes.
-
lexical analyzer
-
scanner
-
parser
-
code generator
-
Top-down parsing
-
Bottom-up parsing
-
Both 1 and 2
-
None of the above
-
specifying the syntax of a language
-
describing how a program works
-
shell programming
-
multi user programming
A
Correct answer
Explanation
BNF (Backus-Naur Form) is a formal notation used to specify the syntax of programming languages and other formal languages. It defines grammar rules and production rules, not how programs work or shell programming.
-
is a low level language
-
descibes what processing is to be done without specifying the particular procedures to be used
-
is frequently used by software designers
-
all of the above
B
Correct answer
Explanation
descibes what processing is to be done without specifying the particular procedures to be used
-
is a feature of all the programming languages
-
helps make large programs more understandable
-
both (1) and (2)
-
neither (1) nor (2)
B
Correct answer
Explanation
helps make large programs more understandable
-
Lexical analysis
-
Code generation
-
Static analysis
-
Both (1) and (2)
D
Correct answer
Explanation
The compilation process consists of multiple phases: Lexical analysis (breaking source code into tokens) and Code generation (producing machine code) are both valid phases. Other phases include syntax analysis, semantic analysis, and code optimization. Static analysis is typically part of semantic analysis phase.
-
It is a machine language.
-
It is an assembly language.
-
It is a high-level language.
-
None of the above
D
Correct answer
Explanation
Pseudocode is an informal programming description that uses structural conventions of programming languages but is intended for human reading rather than machine execution. It is not machine language (binary), not assembly language (low-level mnemonic), and not a high-level programming language (executable).
-
Machine
-
Procedural
-
Assembly
-
Object-oriented
-
Strictly-typed
B
Correct answer
Explanation
C is a procedural programming language because it follows a procedural paradigm where programs are structured as a sequence of instructions or procedures. It is not object-oriented (like C++ or Java), not strictly-typed (weak typing with implicit conversions), not a machine language, and not an assembly language.
-
Advanced
-
Basic
-
System
-
Compiler
B
Correct answer
Explanation
BASIC is an acronym for Beginner's All-purpose Symbolic Instruction Code, which is a family of general-purpose, high-level programming languages. While 'Advanced', 'System', and 'Compiler' are common terms in computing, they are not acronyms for specific programming languages.
-
high level language
-
assembly level language
-
machine level language
-
middle level language
D
Correct answer
Explanation
C is called a middle level language because it combines the best elements of high level language with the control and flexibility of assembly level languages.
D
Correct answer
Explanation
All modern languages, like, C++, Java, Dot Net etc. are object oriented languages and C is a structural language.