google.com, pub-8786015629279405, DIRECT, f08c47fec0942fa0 Write a Program to Find Factorial of a Number without Recursion in C

Write a Program to Find Factorial of a Number without Recursion in C

0

 



/*Write a Program to Find Factorial of a Number without using Recursion in C.*/

 

#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;   

  }   

  printf("Factorial of %d is: %d",number,fact);   

return 0; 

} 

 

Output

 

Enter a number: 6

Factorial of 6 is 720

 


Post a Comment

0 Comments
* Please Don't Spam Here. All the Comments are Reviewed by Admin.

Thank you for your interest 😊

We will back shortly after reviewing...

Thank you for your interest 😊

We will back shortly after reviewing...

Post a Comment (0)

#buttons=(Accept !) #days=(20)

Our website uses cookies to enhance your experience. Learn More
Accept !
To Top