Calculation of Factorial using Functions.

Write a function to calculate the factorial value of any integer entered through
the keyboard.


#include<stdio.h>
main()
{

int i, f;
int factorial();

printf("Enter the number to evaluate its factorial:");
scanf ("%d", &i);

f=factorial(i);

printf("%d! = %d\n", i, f);

}

factorial(int num)
{
int temp, fact;


for (temp=1,fact=1;temp<=num; temp++)
{

fact=fact*temp;
continue;
}
return (fact);



}






The file can be found at:
Download File

Comments

surya said…
become a follower for free C,C++ And vb code of my blog:
http://www.a2zhacks.blogspot.com to learn C,C++,VB programming.
BASANT KUMAR said…
gigolo The term”gigolo” usually refers to the person who lives an arranged lifestyle that includes many of these relationships in a series, rather than having any other support system.
sniffies Sniffies isn’t bookmarked on my phone, however I’ve been logged in enough that the web target will auto-complete on my personal browser.
erome However, there’s a challenge with streaming online. There are some limitations when streaming online videos. We are limited by the speed of internet, access to internet and other internet-related issues.
basant kumar said…
factorial hundred In the last few days, the “factorial of 100” is one of the top subjects and a lot of maths geeks compute it using voice assistants such as Alexa, Shiri, etc.

Popular posts from this blog

C Program - Calculation of Area and Circumference of a Circle using Pointers

Matchstick Game using C Programming

C Program to Calculate Factorial of a number using Recursion