What is the function of a compiler?

What is the function of a compiler?

a) To convert high-level programming code into machine language
b) To write programs
c) To create data
d) To manage system memory

Answer:

a) To convert high-level programming code into machine language

Explanation:

A compiler is a software tool that translates high-level programming languages (such as C, Java, or Python) into machine code that can be understood and executed by a computer’s processor. The machine code is written in binary (0s and 1s), which the CPU uses to perform tasks.

Compilers are essential in software development, as they allow programmers to write code in human-readable languages and then translate that code into something the computer can understand. Without a compiler, software applications would not be able to run on computers.

Once a program is compiled into machine language, it can be executed on the computer without needing further translation, making the compiled code faster to execute than interpreted code.

Reference:

Computer Fundamental MCQ (Multiple Choice Questions)

Scroll to Top