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

Multiple choice technology operating systems
  1. Hierarchical

  2. Structured

  3. object oriented

  4. Reporting

Reveal answer Fill a bubble to check yourself
B,D Correct answer
Explanation

Natural has two primary programming modes: Structured mode (uses block structures like IF, LOOP) and Reporting mode (generates reports with LIST, DISPLAY statements). Object-oriented is not a Natural programming paradigm, and Hierarchical is not a recognized mode in Natural.

Multiple choice technology mainframe
  1. Search

  2. Search ALL

  3. In-Line Perform

  4. All of the above

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

For tables with fewer than 20 elements, an inline PERFORM VARYING is more efficient than binary search methods like SEARCH ALL. The overhead of setting up a table index for SEARCH/SEARCH ALL outweighs benefits for small datasets. Inline perform provides simple sequential access without additional table setup requirements.

Multiple choice technology mainframe
  1. 01 is record level

  2. No multiple record level fields

  3. Occurs repeat the fields only

  4. All of the above

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

The OCCURS clause cannot be used at 01 level because 01 represents the record definition itself, not a repeating field within a record. Multiple 01-level entries define separate record formats, not repeated fields. OCCURS is designed to repeat data items within a record structure, not repeat entire records. All these reasons combine to make 01-level OCCURS invalid in COBOL.

Multiple choice technology platforms and products
  1. Visual Basic

  2. Visual C++

  3. Visual C#

  4. Visual F#

  5. None of the Above

Reveal answer Fill a bubble to check yourself
E Correct answer
Explanation

Visual Studio 2010 supported all the listed languages: Visual Basic, Visual C++, Visual C#, and Visual F#. F# was actually introduced as a first-class language in VS 2010. Therefore 'None of the Above' is correct because all the mentioned languages ARE supported.

Multiple choice technology programming languages
  1. ERROR RECOVERY

  2. ROLLBACK

  3. Any one of the above

  4. Both of the above

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

In COBOL ENVIRONMENT DIVISION, programs (not subroutines) should have both ERROR RECOVERY and ROLLBACK paragraphs. These paragraphs handle error conditions and transaction recovery. The question follows COBOL mainframe programming standards where recovery sections are required for robust program execution.

Multiple choice technology programming languages
  1. ERROR RECOVERY

  2. ROLLBACK

  3. None of the above

  4. Both of the above

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

In certain enterprise COBOL programming schemas, the subroutine structure requires the ERROR RECOVERY paragraph in the ENVIRONMENT DIVISION to handle execution-time anomalies and provide structured recovery blocks, distinguishing it from standard programs which do not enforce this section.

Multiple choice technology programming languages
  1. ERROR RECOVERY

  2. ROLLBACK

  3. Any one of the above

  4. Both of the above

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

A program (not a subroutine) in the ENVIRONMENT DIVISION should have both ERROR RECOVERY and ROLLBACK paragraphs (D). ERROR RECOVERY handles exceptional conditions, while ROLLBACK manages transaction rollback on failure. Having both ensures comprehensive error handling and data integrity. Either one alone is insufficient.

Multiple choice technology
  1. Output Control Work

  2. Output Control Word

  3. Output Common Word

  4. Output Common Work

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

In microprocessor and I/O systems, OCW stands for Output Control Word, which is used to control the operation of output devices or ports. The Output Control Word configures how the system interfaces with external hardware.

Multiple choice technology programming languages
  1. 20,10

  2. 10,20

  3. 1,10

  4. 20,2

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

This code uses XOR swap algorithm. a=10, b=20. After a=a^b: a=30, b=20. After b=a^b: a=30, b=10. After a=a^b: a=20, b=10. The XOR operation reverses the swap in the last step, effectively exchanging the values. This is a classic technique for swapping without a temporary variable.

Multiple choice technology programming languages
  1. JavaScript

  2. LiveScript

  3. WireScript

  4. ECMAScript

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

JavaScript was originally named LiveScript when it was developed by Netscape. It was renamed to JavaScript as a marketing move to capitalize on Java's popularity. ECMAScript is the official standard name, not the original name. WireScript is not related.

Multiple choice technology web technology
  1. S9(04) COMP

  2. S9(04) COMP-3 SIGN LEADING

  3. COMP-1 SIGN LEADING

  4. S9(04) COMP-3

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

The correct answer is A (S9(04) COMP). COMP stores numbers in binary format which is more space-efficient than COMP-3 (packed decimal). For a 4-digit number like +3473, COMP uses only 2-4 bytes depending on the platform, while COMP-3 would use at least 3 bytes. The binary format is the most compact representation, making it best when memory conservation is the priority.

Multiple choice technology programming languages
  1. SY-INDEX

  2. SY-DBCNT

  3. SY-RECNO

  4. SY-TABIX

  5. SY-LNCNT

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

In ABAP, sy-dbcnt is the system field that stores the number of database table rows affected or returned by the last SQL statement. sy-index is the loop iteration counter, sy-tabix is the index of the current line in an internal table, and sy-lncnt relates to printing line counts.

Multiple choice technology programming languages
  1. A&C

  2. A&D

  3. C&D

  4. B&D

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

When creating an ABAP program, the required attributes are Type and Title. Application specifies where the program belongs and Status tracks its lifecycle stage, but neither is mandatory. A program can exist without an assigned application or status designation.