Write a program using while loop?

1 answer

Answer

1155444

2026-08-18 23:15

+ Follow

//program to find the factorial value f any number using while loop

#include<stdio.h>

void main()

{

int i,n,fact=1;

printf("Enter the number\n");

scanf("%d",&n);

i=n;

while (i>=1)

{

fact=fact*i;

i--;

}

printf("The factorial value=%d",fact);

}

the above is a program for calculating tha factorial value of any number which is entered by the user

ReportLike(0ShareFavorite

Copyright © 2026 eLLeNow.com All Rights Reserved.