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
-
Spaces, tabs & linefeeds
-
Kernel
-
Haskell
-
Nutshell
D
Correct answer
Explanation
Python is well-known for using significant whitespace (indentation) to define block structure, unlike languages like Java, C++, or Cobra that use braces/end keywords. Python's syntax relies on consistent indentation for nested blocks, making it the correct answer. Options A, B, C use brace-based syntax.
-
Compiled
-
Interpreted
-
Both
-
None
B
Correct answer
Explanation
Perl is primarily an interpreted language, though Perl scripts can be compiled to bytecode. Unlike C or Java which are compiled to native code, Perl code is typically executed by the Perl interpreter. Option B correctly identifies Perl as interpreted.
-
Practically Extracted Reporting Language
-
Practical Extraction report Language
-
Practical Extraction and report Language
-
Practical Export and report Language
C
Correct answer
Explanation
Perl officially stands for 'Practical Extraction and Reporting Language'. Option C has the exact wording. Options A and B have 'Extracted' instead of 'Extraction' and missing 'and'. Option D uses 'Export' which is incorrect.
-
Modules
-
Classes
-
Packages
-
Libraies
A
Correct answer
Explanation
Perl libraries are called modules and use .pm extension. Modules are packages defined in separate files that can be imported into your Perl scripts using use or require statements.
-
Complete
-
Easy to use
-
Efficient
-
Not agreed with above three
A,B,C
Correct answer
Explanation
Perl's practical design philosophy emphasizes being complete (full-featured), easy to use (familiar syntax for C/sed/awk users), and efficient (fast execution). The combination makes it practical for real-world tasks.
-
Subscript
-
Index
-
Either
-
Author should learn COBOL
A
Correct answer
Explanation
C# uses XML documentation comments (///) that are conceptually similar to Javadoc's /** */ syntax. Both systems allow embedding documentation directly in source code that can be extracted into formatted HTML documentation. Option D 'Cdoc' is not a real documentation system.
-
Microsoft
-
HP
-
Intel
-
Borland
A,B,C
Correct answer
Explanation
When C# was submitted as an ECMA standard in 2000, it was co-sponsored by Microsoft (the creator), HP, and Intel. These companies jointly submitted the specifications to ECMA International for standardization. Borland was not a co-sponsor of the initial C# specification.
B
Correct answer
Explanation
MRTG (Multi Router Traffic Grapher) was written by Tobias Oetiker using the Perl programming language. Perl was chosen for its excellent text processing capabilities and cross-platform support. This choice made MRTG portable across different UNIX variants and other operating systems. The Perl source code can be run on any system with a Perl interpreter.
-
Binary Language
-
Machine Language
-
Primary Language
-
Assembly Language
B
Correct answer
Explanation
First-generation programming languages are machine languages, which consist of binary code (0s and 1s) that can be directly executed by the CPU. Binary Language refers to the binary format itself rather than the language category. Assembly Language is second-generation, and Primary Language is not a standard classification.
-
Assembly
-
PASCAL
-
COBOL
-
BASIC
D
Correct answer
Explanation
BASIC is traditionally implemented with an interpreter, allowing for interactive programming and immediate execution of commands. Assembly language uses assemblers (not interpreters), while Pascal and COBOL are primarily compiled languages. The interpreted nature of BASIC made it popular for educational purposes and rapid prototyping.
-
Business
-
Scientific
-
Simulation
-
All of the above
A
Correct answer
Explanation
COBOL (Common Business-Oriented Language) was specifically designed for business applications, particularly for data processing tasks in finance, administration, and government sectors. It excels at handling large volumes of data with fixed record formats. It was not designed for scientific computing or simulation purposes.
-
COmmon Business Oriented Language
-
Common OBservation Official Language
-
COmputer Basic Operating Language
-
None of the above
A
Correct answer
Explanation
COBOL stands for COmmon Business Oriented Language. It was designed in 1959 by CODASYL for business data processing, emphasizing readability and ease of use in business applications, making the other options incorrect.
-
Identification Division
-
Linkage Division
-
Data Division
-
Procedure Division
B
Correct answer
Explanation
COBOL programs have four main divisions: Identification, Environment, Data, and Procedure. The Linkage Section is part of the Data Division, not a separate division. It's used for defining data passed between programs.