Thursday, 4 December 2014

Example program on preprocessor directives


#include<stdio.h>
#include<stdlib.h>
#define a 2+5
//#define a 5-2
main()
{
int i;
i=a*a*a;
printf("result:%d\n",i);
}
OutPut:
madan@madan-Lenovo-G570:~/madan/osconcepts$ cc ex30.c
madan@madan-Lenovo-G570:~/madan/osconcepts$ ./a.out
result:27