01 Feb 2010 @ 9:50 PM 

A C program for finding a Factorial of user entered number.

How to copy the code in your notepad

In order to copy this code move your cursor to upper right corner of the post a source button will appear click on it and copy the code.

#include<stdio.h>
#include<conio.h>
void main() {
 int i,n,ans;
 clrscr();
 printf("\n  Enter the number: ");
 scanf("%d",&n);
 ans=1;
 for (i=n;i>=1;i--) {
 ans=ans*i;
 }
 printf("\n  The factorial of this number is %d",ans);
 printf("\n\n   Press any key to exit the program...");
 getch();
}
Posted By: EzoecIsoc
Last Edit: 01 Feb 2010 @ 10:15 PM

EmailPermalinkView Comments
Tags

 Last 50 Posts
Change Theme...
  • Users » 2
  • Posts/Pages » 5
  • Comments » 0
Change Theme...
  • VoidVoid « Default
  • LifeLife
  • EarthEarth
  • WindWind
  • WaterWater
  • FireFire
  • LightLight

Welcome



    No Child Pages.

Blog



    No Child Pages.