Pages

Friday 1 February 2019

PROGRAM TO FIND FACTORIAL OF A GIVEN NUMBER

PROGRAM TO ILLUSTRATE FACTORIAL OF A GIVEN NUMBER

// prg to illustrate factorial of a  given number 
#include<stdio.h>
void main()
{
 int n,fact=1,num;
 printf("enter any number:");
 scanf("%d",&n);
 num=n;
 while(n != 0)
   {
   fact = fact * n;  
   n--;
  }
  printf("%d factorial is %d \n",num,fact);


output:

No comments:

Post a Comment

Programs in turboc3 : Files

File Handling in C File Handling concept in C language is used for store a data permanently in computer. Using this concept we can store our...