Friday, August 19, 2011

Program to calculate the Factorial of number without using function.

//Program to calculate the Factorial of number without using function.
#include<stdio.h>
#include<conio.h>
#include<dos.h>
void main()
{
  int i,n;
  long fact=1;
  clrscr();
  printf("The values of n");
  scanf("%d",&n);
  for(i=1;i<=n;i++)
  {
    fact=fact*i;
  }
  printf("\n factorial of %d= %ld",n,fact);
  getch();
}

Previous Next Home
0 Comments
Comments

Leave a Comment

:)) ;)) ;;) :D ;) :p :(( :) :( :X =(( :-o :-/ :-* :| 8-} :)] ~x( :-t b-( :-L x( =))

Twitter Delicious Facebook Favorites More