Write a C program to calculate SQUARE of given number using MACRO.

 C File =>


/* Write a C program to calculate SQUARE of given number using MACRO. */


#include<stdio.h>
#define SQUARE(x)  x*x
int main() {
int n;
printf("\n Enter number : ");
scanf("%d",&n);
printf("\n Square of %d is %d",n,SQUARE(n));
return 0;
}

Comments

Popular posts from this blog

Write a program to allocate memory dynamically for n integers. Accept the elements and calculate their sum and average

C program to accept names of n cities and search for city named “Pune”.