Friday, March 28, 2014

Calculate factorial of any number given by the user

#include<stdio.h>
#include<stdlib.h>
void line()
{
int i,j;
printf("\n");
for(i=1;i<=42;i++)
printf("=");
}
void header()
{
printf("\n");
printf("Built and Designed by Arslan Malik\n\n www.CworldbyAS.blogspot.com");
printf("\n");
}
int main()
{
line();
header();
line();

int i,j=1,k;
printf("\nEnter Value  : ");
scanf("%d",&k);
for(i=1;i<=k;i++)
j*=i;
printf("%d",j);
return 0;
}

No comments:

Post a Comment