Search & Find out

Saturday, November 21, 2009

Factorial of 'n' number

           #include "stdio.h"
            #include"conio.h"

            void main()
            {
                clrscr();
                int n,i,f=1;
                printf(" Enter a number ");
                scanf("%d",&n);

                for(i=n;n>0;n--)
                {
                    f=f*i;
                }


            printf("\n\n The factorial of the number %d is %d",n,f);

            getch();

        }



Download the executable (.exe)  file for this program..
download

0 comments:

Post a Comment

 

My Blog List

Term of Use