Computer Science, asked by aaliyatalwar, 18 days ago

Write programs to calculate the factorial of a number using a while loop.

Answers

Answered by mrsanjusingh78
2

Answer:

Factorial Program using loop

#include<stdio.h>

int main()

{

int i,fact=1,number;

printf("Enter a number: ");

scanf("%d",&number);

for(i=1;i<=number;i++){

fact=fact*i;

Explanation:

here is your answer if youlike my answer please follow

Answered by toufeeque6426
0

Answer:

Explanation:

Factorial Program using loop

#include<stdio.h>

int main()

{

int i,fact=1,number;

printf("Enter a number: ");

scanf("%d",&number);

for(i=1;i<=number;i++){

fact=fact*i;

Similar questions