Write a program in c to find the factorial of a given number (>0) using pointers. (the input is taken from the test case)
Answers
Answered by
0
Factorial program in C using a for loop
#include <stdio.h>
int main()
{
int c, n, fact = 1;
printf("Enter a number to calculate its factorial\n");
scanf("%d", &n);
for (c = 1; c <= n; c++)
fact = fact * c;
Similar questions
Hindi,
7 months ago
English,
7 months ago
Computer Science,
1 year ago
Social Sciences,
1 year ago
Social Sciences,
1 year ago