C Program to find square of a number using macro functions
Program
#include<stdio.h>
#define SQUARE(x) ((x)*(x))
void main()
{
int y, x;
printf("Enter a number:\t");
scanf("%d", &x);
y = SQUARE(x);
printf("Squared number is:\t%d\n", y);
}
Output
Enter a number: 5
Squared number is: 25