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
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
http://www.a2zhacks.blogspot.com to learn C,C++,VB programming.
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.