answersLogoWhite

0


Best Answer

#define fact(n) ( n == 0 ? 1 ; (n*(fact(n-1) ) ) )

User Avatar

Wiki User

11y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Define a macro to find the factorial of a given number?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Write a preprocessor directive to accomplish define macro square volume that computes the volume of a square the macro takes one argument?

Pick one: #define SQUARE_AREA(A) ((A) * (A)) #define CUBE_VOLUME(A) ((A) * (A) * (A))


What is a NULL Macro?

# define pi 3.17 // tihs is a preprocessing directive macro. "pi" is called macro template " 3.17" is the macro value. means in entire program pi value is 3.17. if we declared like # define pi 0 means pi value is zero means null. so the macro template which carries a null value is called a NULL MACRO.


Define the four macro skills?

The four macro skills are associated with learning any language. These four macro skills are speaking, listening, writing, and reading.


How do you divide two numbers in a macro?

#define TOTAL_NUM_FFTS ((int) (NO_SAMPLES) / (FFT_SIZE))


Macro in C Language?

Macros are very common and often used in C programming to declare constants, such as strings, addresses, or any other values such as maximum number of elements in an array, and so on. For those who are not familiar with them, Macros are declared by the #define keyword. Macros are also used to define some basic functionality given a set of 1 or more typeless parameters, similarly to an inline function.


What macro-world example is given to visualize this difference in size?

nothing!


Define micro and macro nutrients?

Macro nutrients = six nutrients are required by the plants in large quantities and hence these are called macro nutrients. Micro nutrients = iron , manganese , zinc , copper , molybdenum , boron and chlorine are the micro nutrients which used in small quantities.


What are the function of a processor?

The preprocessor handles directives for source file inclusion (#include), macro definitions (#define), and conditional inclusion (#if).


How you can interchange two integer values using swap variable in c language?

t = a; a = b; b = t; // t is a third integer variable (swap variable) But here's a way without a swap variable, given as as a macro in C: #define SWAP(a,b) { if (a!=b) { a^=b; b^=a; a^=b; }} // Swap macro by XOR Once you define it, you can say swap(x,y) to swap x and y. The numbers kind of flow through each other and end up swapped.


What are the functions of a c processor?

The preprocessor handles directives for source file inclusion (#include), macro definitions (#define), and conditional inclusion (#if).


How do you write a c program to calculate the circumference of the circle using macros with parameters?

// macro definitions: #define PI 3.14159265358979323846 #define CIRCUMFERENCE(radius) (2. * (radius) * PI) // use this as in CIRCUMFERENCE(21.34)


How do you record macros?

Go to the Tools menu, then pick Macro and then Record New Macro. Do the things you want to do and press the stop icon in the little toolbar that will have appeared. You will also have to give a name to your macro and you will be given an option to set a shortcut key for it.