Example 1
#include <stdio.h>
#define SUM a+b // Macros used just to replace values .
// Whenever compiler see 'SUM' keyword in the program
// it will replaced with a+b .
// It works on the principal of function, so you don't have to
// write same long particular statement every where in the program
int main (){
int a = 5,
b = 3,
c;
c = SUM - 1; // this statement is same as c = a + b - 1;
printf("%d", c);
return 0;
}
#include <stdio.h>
#define SUM a+b // Macros used just to replace values .
// Whenever compiler see 'SUM' keyword in the program
// it will replaced with a+b .
// It works on the principal of function, so you don't have to
// write same long particular statement every where in the program
int main (){
int a = 5,
b = 3,
c;
c = SUM - 1; // this statement is same as c = a + b - 1;
printf("%d", c);
return 0;
}