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
  1. Compiler

  2. Interpreter

  3. Assembler

  4. Comparator

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

An assembler converts assembly language (mnemonic instructions like MOV, ADD) to machine language (binary code the CPU executes). Compilers translate high-level languages to machine code, interpreters execute high-level code directly, and comparators compare data files. The assembler specifically handles assembly-to-machine translation.

Multiple choice
  1. low level language

  2. machine language

  3. object oriented language

  4. assembly language

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

C++ is a multi-paradigm programming language that supports object-oriented programming. While it also supports procedural and generic programming, its key feature is object-oriented capabilities like classes, inheritance, and polymorphism. Low-level languages (like assembly) and machine languages are closer to hardware, while C++ provides abstraction with hardware access when needed.

Multiple choice
  1. iostream

  2. fstream

  3. ofstream

  4. ifstream

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

fstream is the correct C++ class for file operations that require both input and output capabilities. The ios::in | ios::out flags indicate we need to both read from and write to the file, which fstream supports. iostream only handles console I/O, while ifstream and ofstream are specialized for input-only or output-only operations respectively.

Multiple choice
  1. System monitor

  2. Program generator

  3. Process monitor

  4. Client side diagnostic tool

  5. Burp scanner

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

This tool is a software system that accepts the specification of a program to be generated and generates a program in the target PL. With a program generator a user only be required to specify the steps or rules required need to write any code.

Multiple choice
  1. Program execution activity

  2. Program generator domain

  3. Program generation activity

  4. Pseudo-operations

  5. Caching

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

This technique is used to represent the automatic generation of a program and source language is a specification language of an application domain.

Multiple choice
  1. Semantic analysis

  2. Permission analysis

  3. Control flow analysis

  4. Data flow analysis

  5. Lexical analysis

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

The task of scanning source statement, recognising and classifing the various tokens is known as lexical analysis. In this analysis, the text is read and divided into tokens and each of which corresponds to a symbol in the programming language.