Macros
Object macros
Function 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);
}
#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));
}
void main()
{
int a ,b;
printf("a&b=");// for input
scanf("%d%d",&a,&b);
printf("%d",malti(a,b));
}
Comments
Post a Comment