System Programming Asignment
System Programming Asignment
Nandankar
2nd year 4sem
BRANCH: CSE
SECTION: A
SUBJECT: SYSTEM PROGRAMMING
Que1. Introduction to Macro
Processing
Q1. Define macro processing and explain its
significance in systems programmingt
int main() {
return 0;
}
When the macro processor encounters the macro call MAX(x, y), it will
replace it with the following code:
(x > y) ? x : y
This is the body of the macro definition, with the arguments x and y substituted for
the parameters a and b.
The macro processor will then continue to process the program, and the printf()
statement will be executed as follows:
printf("The maximum value is %d\n", (x > y) ? x : y);
programming operations.
Modular programming: Parameters can be passed to the macro so that the macro itself
doesn't need to be changed before execution.
Readability: The main program can become more readable.
Call multiple times: You can call a macro multiple times with different data each time.
Here's some more information about parameter substitution:
Each parameter starts with the character & which helps in the substitution of parameters
during macro expansion.
Macro parameters are substitution symbols that represent a character string.
A special symbol, called a substitution symbol, is used for macro parameters.