Logo 
Search:

C Programming Articles

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

Program to find factorial of user specified number

Posted By: Alicia Hughes     Category: C Programming     Views: 6392

Write a program to find factorial of user specified number

Code for Program to find factorial of user specified number in C Programming

    #include<stdio.h>
    #include<conio.h>
    void main()
    {
        longint fact=1,i,n;
        clrscr();
        printf("\n ENTER THE VALUE OF N: ");
        scanf("%ld",&n);
        for(i=n;i>=1;i--)
        fact = fact * i;
        printf("\nTHE FACTORIAL VALUE IS %ld",fact);
        getch();

    }

******************** OUTPUT *************************************************

     ENTER THE VALUE OF N: 9

     THE FACTORIAL VALUE IS 362880

*****************************************************************************
  
Share: 


Didn't find what you were looking for? Find more on Program to find factorial of user specified number Or get search suggestion and latest updates.

Alicia Hughes
Alicia Hughes author of Program to find factorial of user specified number is from London, United Kingdom.
 
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!