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. have well indented programs

  2. be able to infer the flow of control from the compiled code

  3. be able to infer the flow of control form the program text

  4. avoid the use of GOTO statements

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

Structured programming :- It is way of programming using the sub structure method, i.e splitting the programs into sub sections. Structured programming prevents confusing transfer of control of avoiding the use of GOTO statements.

Multiple choice
  1. both are procedural language

  2. both are based on$\lambda$−calculus
  3. both are declarative

  4. all of the above

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

$\lambda$-calculus" It provides the semantics for computation with functions so that properties of functional computation can be studied. Both the languages require declaration before use of any object. Both are procedural. So option (4) is correct. Both the languages are based on $\lambda$ calculus, procedural & declarative

Multiple choice
  1. a context free language

  2. a context sensitive language

  3. a regular language

  4. parsable fully only by a turing machine

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

C language is context free language entirely based upon the productions.

Multiple choice
  1. Df $\subset$ Nf and DP $\subset$ NP
  2. Df $\subset$ Nf and DP = NP
  3. Df = Nf and DP = NP

  4. Df = Nf and DP $\subset$ NP
Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

Multiple choice
  1. They enhance the portability of the compiler to other target processors

  2. Program analysis is more accurate on intermediate code than on machine code

  3. The information from dataflow analysis cannot otherwise be used for optimization

  4. The information from the front end cannot otherwise be used for optimization

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

Multiple choice
  1. I and II

  2. I and IV

  3. III and IV

  4. I, III and IV

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

Multiple choice
  1. running application software

  2. low level/system programming

  3. high level programming

  4. machine language programming

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

Initially C language was intended for the system programming. For example, UNIX operating system is written in C language.

Multiple choice
  1. stdio.h

  2. assert.h

  3. alloc.h

  4. malloc.h

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

stdio.h is used for the standard input/output. assert.h contains the assert(). alloc.h contains the malloc(), calloc(), realloc() etc. malloc.h is not a header file.