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. int *p[10]

  2. int (*p)[10]

  3. int *p

  4. none of these

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

The syntax int (*p)[10] declares p as a pointer to an array of 10 integers. The parentheses are crucial - without them, int *p[10] would be an array of 10 pointers. This pointer can point to entire arrays, not individual integers.

Multiple choice
  1. Build a uniform symbol table

  2. Build an identifier table

  3. Parse the source program into basic tokens

  4. All of the above

  5. -

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

Lexical analysis includes the process of converting the characters into tokens. It is combined with the parser, which analyses the syntax of programming languages.

Multiple choice
  1. Terminal Table

  2. Literal Table

  3. Identifier Table

  4. None of these

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

The Terminal Table is a permanent database in compiler design that stores entries for each terminal symbol (tokens) in the language. Terminal symbols are the basic atomic elements that cannot be further broken down, such as keywords, operators, and identifiers. The Literal Table stores string/numeric constants, the Identifier Table tracks variable names, and these are distinct from the Terminal Table.

Multiple choice
  1. Literal Table

  2. Identifier Table

  3. Terminal Table

  4. Source code

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

In the general model of a compiler, the Terminal Table is a permanent database that maintains information about all terminal symbols used in the language. The Identifier Table tracks variables and names, the Literal Table stores constants, and while source code is input, it's not a permanent database structure maintained by the compiler.

Multiple choice
  1. terminal table

  2. literal table

  3. identifier table

  4. reductions

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

In lexical analysis, the terminal table (or literal table) describes all literals and constants used in the source program. It stores token information for literals during the scanning phase. The identifier table tracks variables, reductions are part of parsing, and terminal table is the correct terminology for literals.

Multiple choice
  1. Interpreter

  2. An assembler

  3. An operating system

  4. A compiler

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

 It is a computer program that translates the entire user written program (known as source program) into machine language ( known as object program) at once. It's so fast so it used convert C programs into machine language.

 

Multiple choice
  1. Character Integrated Oriented

  2. Character Input-Output

  3. Console Input Output

  4. Console Indirect Output

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

This is the right option. Conio stands for Console Input Output.

 

Multiple choice
  1. Standard Input Output

  2. Stadio Input Output

  3. System Input Output

  4. Standard Integrated Oriented

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

This is correct. Stdio stands for Standard Input Output.

 

Multiple choice
  1. An operating system

  2. A computer language

  3. A language translator

  4. None of these

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

A language translator