Question: Can you write a macro in C that returns the factorial of an integer argument (without calling a subroutine)? Why or why not? I know

Can you write a macro in C that returns the factorial of an integer argument (without calling a subroutine)? Why or why not?

I know that i cannot use recursion in macro, but there is a iterative implementation of the factorial function:

int factorial(int N) { int product = 1; for (int j = 1; j <= N; j++) product *= j; return product; } 

Is it possible to write a macro in C that returns the factorial of an integer argument (without calling a subroutine)?

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!