Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[C] Factorial function
#2
a better program
Code:
#include <stdio.h>
int main()
{
   int a;
   int c=0;
   int i;
   printf("enter the number for finding fact");
   scanf("%d",&a);
   for(i=1;i<=a;i++)
{
     c+=i;
     printf("the factorial is:%d",c);
}
    return 0;
}

[Image: rana.jpg]
Reply


Messages In This Thread
[C] Factorial function - by Commodore - 10-13-2010, 02:10 PM
RE: [C] Factorial function - by RANA - 11-28-2010, 07:13 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  C++ stdio.h rename function problem AceInfinity 2 1,049 01-14-2012, 08:39 PM
Last Post: AceInfinity
  [C] Prime number function Commodore 2 5,094 10-11-2010, 01:11 PM
Last Post: Commodore
  Problem with a member function of a class charnet3d 2 1,016 10-31-2009, 03:22 AM
Last Post: charnet3d

Forum Jump:


Users browsing this thread: 1 Guest(s)