Computer Science, asked by muralimani212, 6 months ago

Write a program to find the factorial of a number.​

Answers

Answered by Anonymous
4

Explanation:

C program to find factorial of a number

long factorial(int);

int main() { int n;

printf("Enter a number to calculate its factorial\n"); scanf("%d", &n);

printf("%d! = %ld\n", n, factorial(n));

return 0; }

long factorial(int n) { int c; long r = 1;

for (c = 1; c <= n; ..

......

Answered by AestheticAmaira
0

\large{\underline{\underline{\maltese{\green{\pmb{\sf{ \; Question \; :- }}}}}}}

Write a program to find the factorial of a number.

\large{\underline{\underline{\maltese{\pink{\pmb{\sf{ \; Source \: code \; :- }}}}}}}

class Factorial

{

public static void main(int n)

{

long f=1L;

int i;

for(i=1;1<=n;i++)

f=f*i;

System.out.println("Factorial = "+f);

}

}

Similar questions