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
-
atan(x)
-
tan(x/y)
-
sin(x/y)
-
atan2(x,y)
-
cos(x/y)
D
Correct answer
Explanation
This mathematical function is used to return arc tangent of the given expression x/y.
-
cos(x/y)
-
acos(x/y)
-
sin(x/y)
-
tan(x/y)
-
atan(x)
B
Correct answer
Explanation
This mathematical function is used to return arc cosine of the given expression x/y.
-
sin(x/y)
-
cos(x/y)
-
asin(x/y)
-
tan(x/y)
-
atan(x)
C
Correct answer
Explanation
This mathematical function is used to return arc sine of the given expression x/y.
-
Compiler
-
Interpreter
-
Assembler
-
Comparator
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.
-
low level language
-
machine language
-
object oriented language
-
assembly language
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.
-
iostream
-
fstream
-
ofstream
-
ifstream
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.
-
Basic
-
Tally
-
Pascal
-
Fortran
B
Correct answer
Explanation
Tally is fully computerised financial business accounting software. It was developed by Tally solutions private limited India in 1988.
-
Semantic analysis
-
Source code analysis
-
Syntax analysis
-
Control flow analysis
-
Data flow analysis
C
Correct answer
Explanation
This analysis takes the list of tokens produced by the lexical analysis and arranges the tokens in a tree structure.
-
System monitor
-
Program generator
-
Process monitor
-
Client side diagnostic tool
-
Burp scanner
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.
-
Program execution activity
-
Program generator domain
-
Program generation activity
-
Pseudo-operations
-
Caching
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.
-
Linking
-
Allocation
-
Relocation information
-
Pseudo operation
-
Caching
A
Correct answer
Explanation
The process of merging many object modules to form a single machine language program is known as linking.
-
Semantic analysis
-
Permission analysis
-
Control flow analysis
-
Data flow analysis
-
Lexical analysis
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.
-
Program translator
-
Program generator domain
-
Client side diagnostic tool
-
Process monitor
-
Lexer generator
E
Correct answer
Explanation
This tool is used to transform human readable specification of tokens and white spaces into the efficient program.
-
Program translator
-
Program generator domain
-
LR parser
-
Program interpreter
-
System monitor
C
Correct answer
Explanation
This tool can be constructed to recognise virtually all programming language constructs for which context free grammers can be written.
-
Program translator
-
Program generator domain
-
Lexical analyser
-
Protocol analyser
-
Client side diagnostic tools
C
Correct answer
Explanation
This tool takes input the string of individual letters and divide the string into tokens.