Code Competitions

Coding competition

Friday, 31 May 2013

program to find factorial

#include<iostream.h>
#include<conio.h>
void main()
{
    long a,fact=1,i;
    clrscr();
    cout<<"enter the number";
    cin>>a;
    for(i=1;i<=a;i++)
    {
          fact*=i;
    }
    cout<<"the factorial of number is "<<fact;
    getch();
}

No comments:

Post a Comment