Posts

Showing posts with the label Macros

Macros

 Object macros //define Variable from macro its call object macro #include <stdio.h> #define a 10 //no ";" void main() {   int b= 5 ;   printf ( "addition=%d" ,a+b);   } Function Macros //define Function From Macro #include <stdio.h> #define malti(a,b) (a*b) //no ";" void main() {   int a ,b;   printf ( "a&b=" ); // for input   scanf ( "%d%d" ,&a,&b);   printf ( "%d" ,malti(a,b));   }