Sunday, 11 November 2012

C Program to find the factorial of given number without using Recursion

By
Write a program to find the factorial of a given number Without recursion.

C Program to find the factorial of given number without using Recursion
***********************************************************
www.flintgroups.com
***********************************************************
#include<stdio.h>
#include<conio.h>
void main()
{
long f=1,n,i;
clrscr();
printf("|***************************|");
printf("www.flintgroups.com");
printf("|***************************|");
printf("Enter the Number");
scanf("%ld",&n);
for(i=1;i<=n;i++)
{
f=f*i;
}
printf("The Factorial Value For The Number %ld is %ld",n,f);
getch();
}

The Sample outpt for this program is shown below.


0 comments:

Post a comment

Related Posts Plugin for WordPress, Blogger...

Labels