P210. WAP to design function type macro for addition of two numbers.

 

#include<stdio.h>

int sum(int a,int b)

{

        return a+b;

}

#define SUM(a,b) a+b

void main()

{

        int i=10,j=20,r;

        r=sum(i,j);

        printf("r=%d\n",r);

 

        r=SUM(i,j);

        printf("r=%d\n",r);

}

Comments