1.

WAP to find the factorial of ‘n’.

Answer»

#include<stdio.h>
void main()
{
int n, i, fact = 1;
printf (“Enter the value for n”);
scanf (“%d”, &n);
for (i = 1; i <= n; i++)
{
fact = fact * i;
}
printf (“factorial of %d is %d”, n, fact);
}



Discussion

No Comment Found