C program to find the factorial of a number using non-recursive function

What is factorial of a number?

Factorial of a number is nothing but the result of the multiplication of the numbers before it. For instance factorial of 4 is 1*2*3*4=24

Program for factorial of anumber using non recursive function

/* By RAKESH AKUTHOTA */

#include<stdio.h>

#include<conio.h>

void main()

{

int n,f;

clrscr();

printf("enter a number");

scanf("%d",&n);

f=factorial(n);

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

getch();

}

int factorial(int num)

{

int fact=1,i;

{

for(i=1;i<=num;i++)

{

fact=(fact*i);

}

}

return(fact);

}

About me

I am Rakesh Kumar Akuthota studying B.tech (IT) first year at Sree Dattha Institute Of Engineering And Science, Ibrahimpatnam, Hyderabade, Andhra Pradesh, India. I have made these posts in order to help some or the other who are interested in learning c language and at the same time to make some money online inorder to satisfy me dreams of doing an MBA from London or Australia. I love making friends online. If you want me to be a friend of yours then please do send a request at facebook. I also blog at flixya and dollardreams and 14sms

I really want to get your suggestions in the form of comments and they will boost me up. Please leave your valuable fedback and suggestion in the form of comments.

Click edit above to add content to this empty capsule.

Comments 1 comment

anonoymous 2 weeks ago

good work but type in structured format

    Sign in or sign up and post using a HubPages Network account.

    0 of 8192 characters used
    Post Comment

    No HTML is allowed in comments, but URLs will be hyperlinked. Comments are not for promoting your articles or other sites.


    Click to Rate This Article
    working