Opening Ceremony

Bhim Higher Secondary School Suntopar, Dolakha

Opening Ceremony

Bhim Higher Secondary School Suntopar, Dolakha

JCT Students (First Batch(2069-2070))

Bhim Higher Secondary School Suntopar, Dolakha

Opening Ceremony

Bhim Higher Secondary School Suntopar, Dolakha

Opening Ceremony

Bhim Higher Secondary School Suntopar, Dolakha

Showing posts with label Factorial of given number. Show all posts
Showing posts with label Factorial of given number. Show all posts

Sunday, July 31, 2016

Program in C to find the factorial of a given number


/* Program to find the factorial of a given number */
#include<stdio.h>
#include<conio.h>
void main()
{
    int i, num, fact = 1;

  printf("\n Enter a number to calculate it's factorial : ");
  scanf("%d", &num);

  for (i = 1; i <= num; i++)
    fact = fact * i;

  printf(" Factorial of %d = %d\n", num, fact);
  getch();
}