Factorial in c language.

                           Factorial in c language

Factorial is product of integer and all the integer below it.
This blog will introduce you to the concept of finding the factorial of any number.

    Example of factorial 
                                         
 5!=5*4*3*2*1=120

  

 6!=6*5*4*3*2*1=720

 2!=2*1=2




https://programminghub1999.blogspot.com/2018/12/factorial-in-c-language.html

                    

                   Following methods has used in program

  1. Take number from user to find the factorial of number.
  2. Take another number and initialize it by one.
  3. Run the iteration form one to input number.
  4. Apply the statement to find factorial of number.
  5. And finally print the factorial of number.

                       Factorial in c language.

   
          This program has run in  turbo editor.
  



#include<stdio.h>
#include<conio.h>
{
     clrscr();
     int num, multi=1,i;
     printf("Enter number\n");
     scanf("%d",&num);
     for(i=1;i<=num;i++) 
     {
               multi=multi*i;
    }
   printf("Factorial of number is %d",multi);
   getch();
}


Factorial in c language. Factorial in c language. Reviewed by Deepak kumar soni on December 29, 2018 Rating: 5

No comments:

Powered by Blogger.