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
-
is a feature of all the programming languages
-
helps make large programs more understandable
-
both (1) and (2)
-
neither (1) nor (2)
B
Correct answer
Explanation
helps make large programs more understandable
-
Begin()
-
Clear()
-
Find()
-
Erase()
-
Insert()
C
Correct answer
Explanation
This member function of the map class is used to give the location of a specified element.
-
_unlink()
-
putback()
-
flush()
-
peek()
-
getline()
D
Correct answer
Explanation
This I/O stream function is used to return the next character from an input file stream without moving the inside pointer.
-
Lexical analysis
-
Code generation
-
Static analysis
-
Both (1) and (2)
D
Correct answer
Explanation
The compilation process consists of multiple phases: Lexical analysis (breaking source code into tokens) and Code generation (producing machine code) are both valid phases. Other phases include syntax analysis, semantic analysis, and code optimization. Static analysis is typically part of semantic analysis phase.
-
It is a machine language.
-
It is an assembly language.
-
It is a high-level language.
-
None of the above
D
Correct answer
Explanation
Pseudocode is an informal programming description that uses structural conventions of programming languages but is intended for human reading rather than machine execution. It is not machine language (binary), not assembly language (low-level mnemonic), and not a high-level programming language (executable).
-
EnableSession
-
PHP session
-
Session memory
-
SQL injection
-
MySqli_connect
B
Correct answer
Explanation
This session allows an application to store information for the current session, which can be defined as one user being logged into your application.
-
int *x; *x = 0x200;
-
int *x = &0x200;
-
int *x = *0x200;
-
int *x = 0x200;
-
int *x( &0x200 );
-
Machine
-
Procedural
-
Assembly
-
Object-oriented
-
Strictly-typed
B
Correct answer
Explanation
C is a procedural programming language because it follows a procedural paradigm where programs are structured as a sequence of instructions or procedures. It is not object-oriented (like C++ or Java), not strictly-typed (weak typing with implicit conversions), not a machine language, and not an assembly language.
-
visible
-
hidden
-
transparent
-
none of these
A
Correct answer
Explanation
In software engineering and object-oriented design, interface specifications must be visible to clients so they know how to interact with a module or component, while the implementation details remain hidden.
-
Advanced
-
Basic
-
System
-
Compiler
B
Correct answer
Explanation
BASIC is an acronym for Beginner's All-purpose Symbolic Instruction Code, which is a family of general-purpose, high-level programming languages. While 'Advanced', 'System', and 'Compiler' are common terms in computing, they are not acronyms for specific programming languages.
-
A setdisk
-
A getdisk
-
A namedisk
-
A returndisk
B
Correct answer
Explanation
The function getdisk( ) returns the drive number of current drive. The drive number 0 indicates 'A' as the current drive, 1 as 'B' and so on.
-
high level language
-
assembly level language
-
machine level language
-
middle level language
D
Correct answer
Explanation
C is called a middle level language because it combines the best elements of high level language with the control and flexibility of assembly level languages.
D
Correct answer
Explanation
All modern languages, like, C++, Java, Dot Net etc. are object oriented languages and C is a structural language.
C
Correct answer
Explanation
Java was originally developed by James Gosling at Sun Microsystems in the early 1990s under the project name Green, with the initial goal of designing a language for interactive television and consumer electronic devices like set-top boxes.
-
1, 2 and 3
-
2, 3 and 4
-
1, 3 and 4
-
1, 2, 3 and 4
D
Correct answer
Explanation
FORTRAN, BASIC, COBOL, and PASCAL are all well-known high-level programming languages. Each was designed for specific applications, such as scientific computing, business, or education.