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
-
1st generation
-
2nd generation
-
3rd generation
-
4th generation
-
5th generation
B
Correct answer
Explanation
Assembly language belongs to 2nd generation.
-
Identification
-
Environment
-
Function
-
Data
-
Procedure
C
Correct answer
Explanation
This is not a valid division of COBOL.
-
seekg()
-
seekp()
-
get()
-
tellg()
A
Correct answer
Explanation
seekg() sets the current get (input) position in an input stream. The companion function seekp() sets the put (output) position for output streams. The 'g' stands for 'get'.
-
Ada
-
Smalltalk
-
Java
-
Object Pascal
A
Correct answer
Explanation
Ada (in its original versions) was not designed as an object-oriented programming language. It was primarily a structured, imperative language with strong typing. Smalltalk, Java, and Object Pascal all support object-oriented programming. Note: Ada 95 later added OOP features, but the original language did not have them.
-
codes
-
mnemonics
-
assembler
-
compiler
-
None of these
B
Correct answer
Explanation
In assembly language, a mnemonic is a symbol which is entered in the operation code of each assembler program.
-
compiler
-
assembler
-
interpreter
-
language processor
-
None of these
D
Correct answer
Explanation
Language processor is the correct answer. All compiler, assembler and interpreter fall under this category.
-
assembly language
-
source language
-
high-level language
-
object language
-
None of these
B
Correct answer
Explanation
The language used in source program and from which translation is to be done
-
computer program
-
algorithm
-
flowchart
-
utility programs
-
None of these
A
Correct answer
Explanation
It is a sequence of coded instructions written to perform a specified task.
-
compiler
-
debugger
-
interpreter
-
assembler
C
Correct answer
Explanation
Option 3 is the correct answer.
-
Procedural languages
-
Non-Procedural languages
B
Correct answer
Explanation
Fourth Generation Languages (4GLs) are non-procedural - users specify WHAT to do, not HOW. Examples include SQL, query languages, and report generators. Earlier generations (3GL like C, Java) require procedural programming details.
A
Correct answer
Explanation
Low-level languages like assembly and machine code are designed for specific processor architectures. They directly reference hardware-specific registers, instructions, and memory addressing modes. Code written for x86 processors won't work on ARM processors without modification, demonstrating machine dependence. High-level languages provide abstraction and portability across platforms.
-
3, 4, 1, 2
-
4, 3, 1, 2
-
3, 4, 2, 1
-
None of the above
B
Correct answer
Explanation
The correct JDBC sequence is: 1) Register Driver, 2) Get Connection, 3) Create Statement, 4) Execute Query. First, you register the JDBC driver, then establish a connection to the database, create a statement object, and finally execute the SQL query.
-
Vector
-
Hash Table
-
Stack
-
Enumeration
D
Correct answer
Explanation
Enumeration is an interface in Java that allows you to generate (iterate through) a series of elements one at a time from collections like Vector or Hashtable. Unlike other data structures, Enumeration specifically provides the hasMoreElements() and nextElement() methods for sequential access.