0% found this document useful (0 votes)
16 views5 pages

C Program for Calculating Factorial

List of c programs

Uploaded by

ramanji
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views5 pages

C Program for Calculating Factorial

List of c programs

Uploaded by

ramanji
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Sample C Program 3 - Page 1

#include
int main() {
int n, i, fact = 1;
printf("Enter a number: ");
scanf("%d", &n;);
for(i = 1; i <= n; i++) {
fact *= i;
}
printf("Factorial: %d\n", fact);
return 0;
}

Explanation:
This page demonstrates a simple C program example. It includes the code and explanation of how
it works. Each document is extended to multiple pages for demonstration purposes.
Sample C Program 3 - Page 2
#include
int main() {
int n, i, fact = 1;
printf("Enter a number: ");
scanf("%d", &n;);
for(i = 1; i <= n; i++) {
fact *= i;
}
printf("Factorial: %d\n", fact);
return 0;
}

Explanation:
This page demonstrates a simple C program example. It includes the code and explanation of how
it works. Each document is extended to multiple pages for demonstration purposes.
Sample C Program 3 - Page 3
#include
int main() {
int n, i, fact = 1;
printf("Enter a number: ");
scanf("%d", &n;);
for(i = 1; i <= n; i++) {
fact *= i;
}
printf("Factorial: %d\n", fact);
return 0;
}

Explanation:
This page demonstrates a simple C program example. It includes the code and explanation of how
it works. Each document is extended to multiple pages for demonstration purposes.
Sample C Program 3 - Page 4
#include
int main() {
int n, i, fact = 1;
printf("Enter a number: ");
scanf("%d", &n;);
for(i = 1; i <= n; i++) {
fact *= i;
}
printf("Factorial: %d\n", fact);
return 0;
}

Explanation:
This page demonstrates a simple C program example. It includes the code and explanation of how
it works. Each document is extended to multiple pages for demonstration purposes.
Sample C Program 3 - Page 5
#include
int main() {
int n, i, fact = 1;
printf("Enter a number: ");
scanf("%d", &n;);
for(i = 1; i <= n; i++) {
fact *= i;
}
printf("Factorial: %d\n", fact);
return 0;
}

Explanation:
This page demonstrates a simple C program example. It includes the code and explanation of how
it works. Each document is extended to multiple pages for demonstration purposes.

You might also like