#nclude <stdio.h>
#include <conio.h>
void main()
{
int i=1,n,fact=1;
clrscr();
printf("enter a number");
scanf("%d",&n);
while(i<=n)
{
fact=fact*i;
printf("%d",i);
i++;
}
printf("fact=%d",fact);
getch();
}
#include <conio.h>
void main()
{
int i=1,n,fact=1;
clrscr();
printf("enter a number");
scanf("%d",&n);
while(i<=n)
{
fact=fact*i;
printf("%d",i);
i++;
}
printf("fact=%d",fact);
getch();
}
No comments:
Post a Comment