This blog consists of C and C++ programs. C and C++ programming is the basics to learn any programming language. Most of the programs are provided with their respective outputs. This blog also contains Data Structures programs using Object-Oriented Programming (C++). Some of the best books for learning C and C++ programming are also mentioned.

Wednesday 5 June 2013

Program to find the Factorial of the given number

#include<iostream.h>
#include<conio.h>
int main()
{
int n, f, i;
clrscr();
cout<<"Enter a number=";
cin>>n;
f=1;
for(i=1;i<=n;i++)
{
f=f*i;
}
cout<<"\nThe factorial of the number "<<n<<" is "<<f;
getch();
}

No comments:

Post a Comment