-->
Showing posts with label program to print 'n' integers and their factorial value.. Show all posts
Showing posts with label program to print 'n' integers and their factorial value.. Show all posts

program to print 'n' integers and their factorial value.

//to print 'n' integers and their factorial value.
#include<stdio.h>
include<conio.h>
void main()
{
   int number,i,k,fact;
   printf("enter value(upper) for  number 'number'\n");
  scanf("%d",&number);
  for(i=1;i<=number;i++)
    {
        fact=1;
        for(k=1;k<=i;k++)
           {
                    fact=fact*k;
            }
            printf("the factorial value for %d number=%d\n",i,fact);
    }
getch();
}