KR Code Corner
Monday, 25 May 2015
How to find factorial of a number in c++
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int n,m=1;
cout<<"Enter the number to cal. Factorial\n";
cin>>n;
for(int i=1;i<=n;i++)
{
m=m*i;
}
dcout<<m;
getch();
}
Coding Format
Output Format
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment