jituTechnology

jituTechnology

Write a program to calculate the factorial of a given number

Here is the c source code/program for: Write a program to calculate the factorial of a given number.

/* a programme to calculate the factorial of a entered number*/
#include <stdio.h>
#include <conio.h>
void main()
{
     int a,i;
   int fact=1;
   printf(“Enter the number to calculate the factorial: “);
   scanf(“%d”,&a);
   for(i=1; i<=a; i++)
   {
     fact=fact*i;
   }
   printf(“The factorial of %d is %d”,a,fact);
   getch();
}
Add a comment

Comments (1)

  1. Reginald KlepaczApril 5, 2012 Reply
    Definitely believe that that you stated. Your favorite justification appeared to be at the net the easiest thing to consider of. I say to you, I certainly get annoyed while people consider concerns that they plainly do not recognise about. You managed to hit the nail upon the highest and defined out the whole thing without having side-effects , other folks can take a signal. Will likely be back to get more. Thank you

Add a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.



Connect with Me

GPO 8973 NPC 541; Kathmandu Nepal
Phone: +977 9851236800

Calendar

April 2024
S M T W T F S
 123456
78910111213
14151617181920
21222324252627
282930