Friday, 3 October 2014

WAP to find Factorial


#include<conio.h>
#include<stdio.h>
void main()
{
clrscr();
int a=1,x;
printf("  Enter no. ");
scanf("%d",&x);
printf("\n");
for(int i=1;i<=x;i++)
{
a=a*i;
}
printf(" %d",a);
getch();
}

No comments:

Post a Comment

Please write your doubts