Write a program in C to find the factorial of any number entered through keyboard

Write a program to find the factorial of any number entered through keyboard

            #include <stdio.h>
            #include <conio.h>
            void main() {
                        int num, i; clrscr();
                        printf("Number : "); scanf("%d", &num);
                        for(i=num-1; i>=1; i--) {
                                    num=num*i;
                        }
                        printf("\n\nFactorial : %d", num);
                        getch();
            }


Post a Comment