QUESTIONS AND CORRECT ANSWERS
What are the phases of compilation-based execution of a C prorgram? - CORRECT
ANSWER 1. Edit
2. Preprocess
3 Compile
4. Link
5. Load
6. Execute
What does the edit phase of a C program has to be accomplished by? - CORRECT
ANSWER An editor program
T/F:
C program are typed in with the linker. - CORRECT ANSWER False, C program are typed in
with the editor and corrections are made if necessary
Where is the program stored? - CORRECT ANSWER Secondary storage device such as a hard
disk
What are C program file names should end with? - CORRECT ANSWER .c
During stage 2, preprocessing, who gives the command to compile the program? - CORRECT
ANSWER The programmer
T/F:
In a C system, the preprocessor executes automatically before the compiler's transition phase begins -
CORRECT ANSWER True
What kind of "special commands" does the C preprocessor obey? - CORRECT
ANSWER Preprocessor directives
,What is a preprocessor directives? - CORRECT ANSWER Indicates that certain manipulations
are to be performed on the program before compilation
What are some examples of manipulations that is done to the program before compilations? -
CORRECT ANSWER 1. Including other files in the files to be compiled
2. Performing various text replacements
3. Defining various macros
T/F:
#include <stdio.h>
#define <identifier> <replacement text>
are examples of preprocessor directives - CORRECT ANSWER True
During step 3 (after the preprocessing steps) what happens to the C source code? - CORRECT
ANSWER The compiler translates the C modified source code into object code and stores it on
the disk
What is an object code? - CORRECT ANSWER Object code is essentially a machine code, a
binary file that consists of a series of 1's and 0's?
What executes the object code? - CORRECT ANSWER The CPU
T/F:
After the source code is turned into an object code it is complete and executable? - CORRECT
ANSWER False, the object code is not complete and not yet executable
Why can't the object code be executed? - CORRECT ANSWER C programs typically contain
references to functions defined elsewhere , therefore the object code contains "holes".
,How can the "holes" be resolved in a C program? - CORRECT ANSWER Resolved by the
linker
What happens during the linking phase? - CORRECT ANSWER A linker links the object code
with the code for the missing functions to produce an executable image
T/F:
During linking, multiple object files might be combined into one executable - CORRECT
ANSWER True
T/F:
Before the program can be executed, the program must first be placed in memory - CORRECT
ANSWER True
What places the program in memory? - CORRECT ANSWER Loader
What does the loader do? - CORRECT ANSWER Takes the executable image from disk and
transfer it to memory
What produces the source code of a C program? - CORRECT ANSWER Source code is entered
with a text editor by the programmer
What produces the modified source code? - CORRECT ANSWER Preprocessor
What produces the executable code? - CORRECT ANSWER linker
What produces the object code? - CORRECT ANSWER Compiler
What are the four standard data types in C? - CORRECT ANSWER Void, characters, integers,
and floating point data types
, What does C provide to return the size of any data type in bytes? - CORRECT
ANSWER sizeof( )
What does a void return? - CORRECT ANSWER Nothing
How many bytes is a char? - CORRECT ANSWER One byte
What does a char usually represent? - CORRECT ANSWER Represents a value from the ASCII
table
T/F:
A char can also be interpreted as a small integer - CORRECT ANSWER True
How do you declare a single byte in C? - CORRECT ANSWER Using char (data type) keyword
T/F:
Character literals are always in double quotes - CORRECT ANSWER False, character literals
are always single quotes
T/F:
Short int has 2 bytes - CORRECT ANSWER True
T/F:
int (16 bit) has 2 bytes - CORRECT ANSWER True
How many bits is in a byte? - CORRECT ANSWER 8
T/F:
int (32 bit) has 4 bytes - CORRECT ANSWER True
T/F: