Programs in C language
2. Program to find the factorial of given number.#include<stdio.h> #include<conio.h> void main() { int n, p=1; clrscr(); printf("Enter a number:"); scanf("%d",&n); while(n>0) { p = p * n; n--; } printf("Factorial of given number : %d",p); getch(); }Input :
6
Output :
720
Father of C Language
Died: October 9, 2011, Murray Hill
Dennis Ritchie
Born: September 9, 1941, BronxvilleDied: October 9, 2011, Murray Hill