Logo 
Search:

C Programming Articles

Submit Article
Home » Articles » C Programming » Homework HelpRSS Feeds

PROGRAM TO COMPUTES AND PRINTS A TABLE OF FACTORIALS OF ANY GIVEN M

Posted By: Maya Campbell     Category: C Programming     Views: 6718

WRITE A PROGRAM TO COMPUTES AND PRINTS A TABLE OF FACTORIALS OF ANY GIVEN M

Code for PROGRAM TO COMPUTES AND PRINTS A TABLE OF FACTORIALS OF ANY GIVEN M in C Programming

#include <stdio.h>
#include <conio.h>
#include<math.h>

void main()
{
int n,m;
long s=1;
clrscr();
printf("Enter the No :- ");
scanf("%d",&m);
    for(n=m;n>1;n--)
    {
      s=s*n;
    }
printf("\nThe Factorial of Given Number is = %ld\n",s);
getch();

}

/*
********
OUTPUT
********

Enter the No :- 9

The Factorial of Given Number is = 362880
*/
  
Share: 



Maya Campbell
Maya Campbell author of PROGRAM TO COMPUTES AND PRINTS A TABLE OF FACTORIALS OF ANY GIVEN M is from Toronto, Canada.
 
View All Articles

 
Please enter your Comment

  • Comment should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].

 
No Comment Found, Be the First to post comment!