Subject

    Computer Science

    Topic

    Computer Hardware

    What is the function of a 'compiler'?

    a)
    To execute a program line by line.
    b)
    To translate the entire source code of a high-level programming language into machine code before execution.
    c)
    To link multiple object files into a single executable file.
    d)
    To find and fix bugs in a program.

    Explanation

    A compiler performs a one-time translation of the whole program, creating a standalone executable file that can be run by the computer's hardware. This is different from an 'interpreter', which translates and executes the program one statement at a time, without creating a separate executable.

    Find Tutors

    View all Tutors