0% found this document useful (0 votes)
27 views2 pages

Write A Program To Calculate The Factorial Value of Any Integer Entered

The document describes a C program to calculate the factorial of a user-entered integer using a for loop that multiplies incrementing values from 1 to the input number.

Uploaded by

Abrar Nirban
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)
27 views2 pages

Write A Program To Calculate The Factorial Value of Any Integer Entered

The document describes a C program to calculate the factorial of a user-entered integer using a for loop that multiplies incrementing values from 1 to the input number.

Uploaded by

Abrar Nirban
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
You are on page 1/ 2

1. Write a program to calculate the factorial value of any integer entered.

Code:

int main()

int i, Number;

long Factorial = 1;

printf("\n Please Enter any number to Find Factorial\n");

scanf("%d", &Number);

for (i = 1; i <= Number; i++)

Factorial = Factorial * i;

printf("\nFactorial of %d = %d\n", Number, Factorial);

return 0;

}
Output:

You might also like