Forum
Resources
Mentors
Projects
Entrance Exams
Question Papers
Colleges
Courses
Universities
Schools
Make Money
Members
Bookmarks
Polls
Fresher Jobs
Funny Pictures
MCA Projects
New Member FAQ
My Profile
Sign In
Register
AdSense Revenue
Active Members
Today
prashanth beer...
(936)
nazikha
(535)
Nemish
(422)
Last 7 Days
Nemish
(3224)
pradeep
(3093)
prashanth beer...
(2537)
more...
Awards & Gifts
Online Exams
Aptitude Questions
General Aptitude Tests
Medical Entrance
Engineering Entrance
Bank Tests
TOEFL & IELTS Questions
Fresher Jobs
Our fresher job section is exclusively for fresh graduates! Find jobs for freshers in major Indian cities including Bangalore, Chennai, Hyderabad, Pune or Kochi
Resources
Find educational articles, blogs, discussion threads and other resources.
Colleges
Find details about any college in India or search for courses.
Advertisements
Watch Asianet TV online
Kairali TV in Internet
Surya TV online
Amritha TV Channel
Program to calculate factorial of a given number
Posted Date: 26 May 2008 Resource Type:
Articles/Knowledge Sharing
Category:
Education
Posted By:
Vidya
Member Level:
Diamond
Rating:
Points
: 1
Program : Program to calculate factorial of a given number
/**********************************************************************/
/*Program : To show recursion*/
/*Purpose : Program to calculate factorial of a given number*/
/*Date : 19-12-2004*/
/*Time : 05:10*/
/**********************************************************************/
#include
#include
/********** Function Declaration begins **********/
int factorial(int);
/********** Function Declaration ends **********/
void main()
{
int n, fact;
clrscr();
printf(“\n\t\t Program to calculate the factorial of a number:”);
printf(“\n\n\t\t Enter number to calculate the factorial:”);
scanf(“%d”,&n);
fact =factorial(n);
printf(“Factorial of %d = %d”,n,fact);
getch();
}
/********** Computing Factorial **********/
/********** Function Definition begins **********/
int factorial( int n )
{
if ( n == 0 )
return 1;
else
return n* factorial(n-1);
}
/********** Function Definition ends **********/
? OUTPUT
Program to calculate the factorial of a number:
Enter number to calculate the factorial:7
Factorial of 7 = 5040
Responses
No responses found. Be the first to respond and make money from
revenue sharing program
.
Feedbacks
Popular Tags
What are tags ?
Search Tags
Sign In
(No tags found.)
Post Feedback
This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must
Sign In
to post a response.
Next Resource:
M.Sc Wood Science & Technology
Previous Resource:
Program to compute minimum spanning tree using prims technique.
Return to Discussion Resource Index
Post New Resource
Category:
Education
Post resources and
earn money
!
Related Resources
3-2 CSE 2ND MID ONLINE BITS
All India Engineering Entrance Examination (AIEEE) 2008 Maths Syllabus
ANNUNIVERSITY,BE CIVIL ENGINEERING,IV SEMESTER, CE1255-HIGHWAY ENGINEERING
Careers in Advertising: Colleges and courses
Some important terms used in Hydraulics Engineering.
Contact Us
Privacy Policy
Terms Of Use
SpiderWorks Technologies Pvt Ltd. 2006 - 2007 All Rights Reserved.