Monday, 24 August 2015

Write a C Program To Find Factorial Of Inputed Number Using Float

#include<stdio.h>
#include<conio.h>

int main()
{
            int i,n,f=1;
            clrscr();

            printf("\n Enter the Number : ");
            scanf("%d",&n);

            for(i=1;i<=n;i++)
            {
                  f=f*i;
            }

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

            getch();

            return 0;

}

No comments:

Post a Comment