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
-
int *p[10]
-
int (*p)[10]
-
int *p
-
none of these
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.
-
Literal
-
Terminal
-
Identifier
-
All of the above
-
-
B
Correct answer
Explanation
Terminal tables have permanent database entries for each terminal symbol. In this, data structures used by compiler keep the track of terminal tables of the syntactic analysis.
-
Build a uniform symbol table
-
Build an identifier table
-
Parse the source program into basic tokens
-
All of the above
-
-
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.
-
LOGO
-
PC/M
-
SNOBOL
-
PL/1
-
None of these
B
Correct answer
Explanation
PC/M stands for programming language for micro computers. Because it gives high speed input/output operations and user friendly command language.
-
Terminal Table
-
Literal Table
-
Identifier Table
-
None of these
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.
-
Literal Table
-
Identifier Table
-
Terminal Table
-
Source code
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.
-
terminal table
-
literal table
-
identifier table
-
reductions
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.
-
Assembler
-
Compiler
-
Interpreter
-
Browser
-
Interpreter
-
An assembler
-
An operating system
-
A compiler
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.
-
Character Integrated Oriented
-
Character Input-Output
-
Console Input Output
-
Console Indirect Output
C
Correct answer
Explanation
This is the right option. Conio stands for Console Input Output.
-
Standard Input Output
-
Stadio Input Output
-
System Input Output
-
Standard Integrated Oriented
A
Correct answer
Explanation
This is correct. Stdio stands for Standard Input Output.
-
stdio.h
-
conio.h
-
math.h
-
iostream.h
D
Correct answer
Explanation
This header file is not used in C language. This is used in C++ language because of its additional features.
C
Correct answer
Explanation
It stands for formula translation. It is developed for mathematical and scientific problems. This language is used for scientific and engineering applications where more calculation power is needed than storage and retrieve facilities.
-
An operating system
-
A computer language
-
A language translator
-
None of these
-
Delete
-
Malloc
-
Calloc
-
Delete []
-
New
E
Correct answer
Explanation
This operator is used in C++ to dynamically allocate memory space for a new node in the linked list.