- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Environmental Science
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Write C Program to Find Factorial of Number Using Recursion
#include stdio.h>
#include conio.h>
int fact(int);
int main() {
int factorial, num;
printf("Enter the value of num :");
scanf("%d", &num);
factorial = fact(num);
printf("Factorial is %d", factorial);
return (0);
}
int fact(int n) {
if (n == 0) {
return (1);
}
return (n * fact(n - 1));
}
- Related Questions & Answers
- How to reads customer number and power consumed and prints amount to be paid using C
- How to print hello world using C Language
- How to Calculate Area of Rectangle using C Program
- Find Second largest element in an array using C Programming
- How to calculate sum of 5 subjects and find percentage Using C Program
- How to Find Area of Scalene Triangle using C
- Recursive program to linearly search an element in a given array using C
- How to Calculate Area of Circle using C Programming
- Write C program to find Exponent Power Series
- How to Calculate Area of Equilatral Triangle using C Language
- Write C Program to Find Smallest Element in Array in C Programming
- How to convert temperature from degree centigrade to Fahrenheit using C
- Write C Program to Calculate Addition of All Elements in Array
- How to find gretest in 3 number using C Programming
- Write C Program to Find Factorial of Number Using Recursion
- Write C Program to Reversing an Array Elements in C Programming
Advertisements
ads