Simple C program for Nested macro.

#include<stdio.h>
#define SQU(x) (x*x)
#define CUBE(x) (x*SQU(x))
int main()
{
    int x,S,C;
    printf("\ Enter a number: ");
    scanf("%d",&x);
    S=SQU(x);
    C=CUBE(x);
    printf("\n The square of %d is %d",x,S);
    printf("\n The cube of %d is %d",x,C);
    return 0;
}


****INPUT && OUTPUT****



Post a Comment

0 Comments