How to find cube of a number using macro in C

1 Answer

0 votes
#include <stdio.h>

#define CUBE(x) (x * x * x)

int main()
{
    int num = 9;

    printf("CUBE(%d) = %d", num, CUBE(num));

    return 0;
}



/*
run:

CUBE(9) = 729

*/

 



answered Apr 19, 2022 by avibootz

Related questions

1 answer 253 views
1 answer 190 views
1 answer 233 views
1 answer 214 views
1 answer 239 views
1 answer 228 views
...