Docsity

Factorial Calculation Program in C, Exercises of Computer Engineering and Programming

Partial preview of the text

Download Factorial Calculation Program in C and more Exercises Computer Engineering and Programming in PDF only on Docsity!

#include<stdio.h> #include<conio.h> void main() { long int a,b=1,i; clrscr(); printf ("Please enter a number\n"); scanf ("%ld",&a); for (i=a; i>=1; i=i-1) printf("The factorial of the given number is: %ld",b); getch(); } { b=i*b; }^ Factorial^1 docsity.com