You need to end the recursion at some point:
int factorial(int b) /*Function definition*/
{
if (b == 0) return 1;
return b*factorial(b-1);
}
More Related Contents:
- Recursive C function
- How to sum the digits of a number using Recursion [C]? [closed]
- can anyone explain the output of the following code in c [closed]
- self referential struct definition?
- How to recursively list directories in C on Linux?
- Power by squaring for negative exponents
- How Recursion works in C
- Is a Recursive-Iterative Method Better than a Purely Iterative Method to find out if a number is prime?
- unexpected output in C (recursion)
- How to work on a sub-matrix in a matrix by pointer?
- Linked list recursive reverse
- Cannot calculate factorials bigger than 20! ! How to do so?
- C#: Recursive functions with Lambdas
- Values obtained in case of a recursive function
- Infinite recursion in C
- Parameter evaluation order before a function calling in C [duplicate]
- Pointer Arithmetic In C
- Tail recursion in C++
- SIMD signed with unsigned multiplication for 64-bit * 64-bit to 128-bit
- Reduce matrix rows with CUDA
- Does printf(“%x”,1) invoke undefined behavior?
- Whole one core dedicated to single process
- FFmpeg C API documentation/tutorial [closed]
- Possible to initialize an array after the declaration in C?
- hexadecimal floating constant in C
- Flexible array member not getting copied when I make a shallow copy of a struct
- Difference between surface and texture (SDL / general)
- Comma operator in condition of loop in C
- Difference between pointer to pointer and pointer to array?
- How do I access local C variable in arm inline assembly?