here you find the best simplest implement of programs

code_world

love programing and watch my all easy implement of program hope you like it

Friday, 12 May 2017

implement of factorial of a number



                      factorial of a number 


#include<stdio.h>
#include<conio.h>
void main()
{
 int a[5],i,n,b=1,l;
 clrscr();
 for(i=0;i<5;i++)
 {
  scanf("%d",&a[i]);
 }
 for(i=0;i<5;i++)
 {
  b=a[i];
  l=a[i]-1;
  if(b<=7)
  {
   while(l>=1)
   {
   b=b*l;
   l--;
   }
  printf("%d ",b);
 }
 }
 getch();
}
Share:

Related Posts:

0 comments:

Post a Comment