MCQ IN COMPUTER SCIENCE & ENGINEERING

COMPUTER SCIENCE AND ENGINEERING

COMPILER DESIGN

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
High-level languages need to be compiled into machine code before they can be used by a computer.
A
True
B
False
C
Either A or B
D
None of the above
Explanation: 

Detailed explanation-1: -A high-level language cannot be understood directly by a computer, and it needs to be translated into machine code. There are two ways to do this, and they are related to how the program is executed: a high-level language can be compiled or interpreted.

Detailed explanation-2: -High-level language programs must also be translated to machine language before they can be executed. The translator programs that do this are called compilers (Figure 9-4). Compilers for a particular high-level language can be produced for various computers with different machine languages.

Detailed explanation-3: -Programs written in a high level language must be converted into machine code to run. This is either done ahead of time by converting a whole program to machine code with a compiler program (compiling the code), or line by line as the program runs by an interpreter.

Detailed explanation-4: -A compiler is a computer program that translates a program written in a high-level language to the machine language of a computer. The compiler is used to translate source code into machine code or compiled code.

Detailed explanation-5: -Compilers convert high-level language code to machine (object) code in one session. Compilers can take a while, because they have to translate high-level code to lower-level machine language all at once and then save the executable object code to memory.

There is 1 question to complete.