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
-
LEX
-
Compiler
-
YACC
-
None of these
C
Correct answer
Explanation
YACC is an automatic parser generator.
-
Lexical analyzer
-
Assembler
-
Parser
-
None of these
A
Correct answer
Explanation
Lexical analyzer acts as an interface between the source program and the compiler in the phases of the compiler.
-
Translated origin
-
Load origin
-
Linked origin
-
None of these
C
Correct answer
Explanation
This is the address of the origin assigned by the linker while producing a machine language program.
-
A combination of computer hardware
-
A program which translates from one high-level language to another
-
A program which translates from one high-level to a machine level
-
None of these
-
Reserved Keys
-
Controlled words
-
Reserved words
-
Control Structures
C
Correct answer
Explanation
Reserved words (or keywords) are predefined identifiers in a programming language that have a specific meaning to the compiler or interpreter and cannot be used as variable names or identifiers.
B
Correct answer
Explanation
In BASIC programming, the LET statement is used to assign a value to a variable.
-
assembly language
-
high level language
-
binary coded language
-
machine language
D
Correct answer
Explanation
Machine language is the lowest-level programming language, consisting of binary code (0s and 1s) that the computer's CPU can execute directly.
-
high level language
-
machine language
-
assembly language
-
none of these
C
Correct answer
Explanation
Assembly language uses mnemonics or opcodes (like MOV, ADD, JMP) to represent machine code instructions, making it easier for humans to read than raw binary.
-
macro
-
for loop
-
symbolic constant
-
none of these
C
Correct answer
Explanation
The #define preprocessor directive is primarily used to create symbolic constants or macros. Between the options, symbolic constant is a standard use case.
-
macro
-
stack
-
preprocessor
-
none of the above
C
Correct answer
Explanation
The preprocessor is the first stage of the C compilation process, which handles directives like #include and #define before the actual compilation begins.
-
iteration
-
recursion
-
repeater
-
none of the above
B
Correct answer
Explanation
Recursion is a programming technique where a function calls itself to solve a problem by breaking it down into smaller, similar sub-problems.
-
two
-
one
-
three
-
none of the above
A
Correct answer
Explanation
In C, variables generally have two primary scopes: local scope (within a function or block) and global scope (accessible throughout the program).
-
declaration
-
initialization
-
calling
-
none of the above
A
Correct answer
Explanation
Header files (.h) are primarily used to store declarations of functions, variables, and macros so that they can be shared across multiple source files.
-
break
-
exit()
-
goto
-
none of the above
B
Correct answer
Explanation
The exit() function, defined in stdlib.h, is used to terminate the entire program immediately, regardless of where it is called.