adsense

Hii, welcome to my site. My name is Om prakash kartik. This blog helps you to learn programming languages concepts.

Find Factorial of a given number

Find Factorial of a given number

#include<stdio.h>
#include<conio.h>
 void  main()
    {
      int f,n,i;
      clrscr();
       printf("Enter a no.:-");
       scanf("%d",&n);
       f=1;
       i=n;
       while(i>=1)
       {
         f=f*i;
         i--;
        }
       printf("Factorial=%d",f);
       getch();
       }

    Output :-

                 

    

Post a Comment

1 Comments