SlideShare a Scribd company logo
2
Most read
Sitesbay.com
Factorial Program
Factorial Program in C
Hitesh Kumar
SITESBAY.COM
Sitesbay.com
Factorial Program in C
Factorial of n is the product of all positive descending integers. For example:
5! = 5*4*3*2*1 = 120. Here we write Factorial Program in C
#include<stdio.h>
#include<conio.h>
void main()
{
int fact,i,n;
fact = 1;
printf("Enter any Number: ");
scanf("%d" , &n);
for(i = 1; i <= n; i++)
{
fact = fact*i;
}
printf("Factorial of %d is %d", n , fact);
getch();
}
Output:
Enter any Number: 5
Factorial of 5 is 120

More Related Content

PPT
Instruction cycle
PPTX
Interfacing With High Level Programming Language
PPTX
Life cycle of a computer program
PPTX
bus and memory tranfer (computer organaization)
PDF
Pthread
PPT
Central processing unit and stack organization r013
PPT
Digital Logic Design
PPTX
Computer registers
Instruction cycle
Interfacing With High Level Programming Language
Life cycle of a computer program
bus and memory tranfer (computer organaization)
Pthread
Central processing unit and stack organization r013
Digital Logic Design
Computer registers

What's hot (20)

PPTX
Compiler construction
PPT
Registers
PPT
Top down parsing
PPTX
Huffman's algorithm in Data Structure
PPS
Computer instructions
PDF
Common air protocol
PPTX
Pseudocode flowcharts
PPT
Modes Of Transfer in Input/Output Organization
PPTX
LR(1) and SLR(1) parsing
PPTX
register
PPT
Design issues for the layers
PPTX
Modes of data transfer
PDF
Semaphores
PPTX
Control unit design
PDF
Error detection & correction codes
DOCX
Report 02(Binary Search)
PPTX
ALGORITHMIC STATE MACHINES
PPTX
Minimization of DFA.pptx
PPTX
Instruction Cycle in Computer Organization.pptx
PPTX
Timing and control
Compiler construction
Registers
Top down parsing
Huffman's algorithm in Data Structure
Computer instructions
Common air protocol
Pseudocode flowcharts
Modes Of Transfer in Input/Output Organization
LR(1) and SLR(1) parsing
register
Design issues for the layers
Modes of data transfer
Semaphores
Control unit design
Error detection & correction codes
Report 02(Binary Search)
ALGORITHMIC STATE MACHINES
Minimization of DFA.pptx
Instruction Cycle in Computer Organization.pptx
Timing and control
Ad

More from Hitesh Kumar (20)

DOCX
Abstraction in c++ and Real Life Example of Abstraction in C++
PDF
HTML Interview Questions | Basic Html Interview Questions
PDF
Fibonacci Series Program in C++
PDF
CSS Interview Questions for Fresher and Experience
PDF
Prime number program in C
PDF
Top JSON Interview Questions for Freshers
PDF
Queue in C, Queue Real Life of Example
PDF
Fibonacci series c++
PPTX
Super keyword in java
DOCX
Interface in java
DOCX
Encapsulation in C++
DOCX
Abstract class in java
PPTX
Super keyword in java
PPTX
Final keyword in java
PPTX
Constructor in java
PPTX
Super keyword in java
PPTX
Ternary operator
PPT
File handling in C++
PPTX
Main method in java
PPTX
This keyword in java
Abstraction in c++ and Real Life Example of Abstraction in C++
HTML Interview Questions | Basic Html Interview Questions
Fibonacci Series Program in C++
CSS Interview Questions for Fresher and Experience
Prime number program in C
Top JSON Interview Questions for Freshers
Queue in C, Queue Real Life of Example
Fibonacci series c++
Super keyword in java
Interface in java
Encapsulation in C++
Abstract class in java
Super keyword in java
Final keyword in java
Constructor in java
Super keyword in java
Ternary operator
File handling in C++
Main method in java
This keyword in java
Ad

Recently uploaded (20)

PPTX
Final Presentation General Medicine 03-08-2024.pptx
PDF
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
PDF
STATICS OF THE RIGID BODIES Hibbelers.pdf
PPTX
human mycosis Human fungal infections are called human mycosis..pptx
PDF
Insiders guide to clinical Medicine.pdf
PDF
Basic Mud Logging Guide for educational purpose
PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PPTX
Pharma ospi slides which help in ospi learning
PDF
FourierSeries-QuestionsWithAnswers(Part-A).pdf
PDF
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
PDF
O7-L3 Supply Chain Operations - ICLT Program
PPTX
Microbial diseases, their pathogenesis and prophylaxis
PDF
RMMM.pdf make it easy to upload and study
PPTX
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
PDF
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
PDF
Microbial disease of the cardiovascular and lymphatic systems
PDF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
PPTX
Lesson notes of climatology university.
PDF
2.FourierTransform-ShortQuestionswithAnswers.pdf
PDF
01-Introduction-to-Information-Management.pdf
Final Presentation General Medicine 03-08-2024.pptx
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
STATICS OF THE RIGID BODIES Hibbelers.pdf
human mycosis Human fungal infections are called human mycosis..pptx
Insiders guide to clinical Medicine.pdf
Basic Mud Logging Guide for educational purpose
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
Pharma ospi slides which help in ospi learning
FourierSeries-QuestionsWithAnswers(Part-A).pdf
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
O7-L3 Supply Chain Operations - ICLT Program
Microbial diseases, their pathogenesis and prophylaxis
RMMM.pdf make it easy to upload and study
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
Microbial disease of the cardiovascular and lymphatic systems
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
Lesson notes of climatology university.
2.FourierTransform-ShortQuestionswithAnswers.pdf
01-Introduction-to-Information-Management.pdf

Factorial Program in C

  • 1. Sitesbay.com Factorial Program Factorial Program in C Hitesh Kumar SITESBAY.COM
  • 2. Sitesbay.com Factorial Program in C Factorial of n is the product of all positive descending integers. For example: 5! = 5*4*3*2*1 = 120. Here we write Factorial Program in C #include<stdio.h> #include<conio.h> void main() { int fact,i,n; fact = 1; printf("Enter any Number: "); scanf("%d" , &n); for(i = 1; i <= n; i++) { fact = fact*i; } printf("Factorial of %d is %d", n , fact); getch(); } Output: Enter any Number: 5 Factorial of 5 is 120