C program to check factorial, C/C++ Programming

C Program to check FACTORIAL

 

main()

{

            int i,j,m,fact,sum=0;

          clrscr();

          printf("ENTER THE NO.: ");

          scanf("%d",&m);

          for(i=1;i<=m;i++)

          {

                   fact=1;

                             for(j=1;j<=i;j++)

                             {

                                      fact=fact*j;

                             }

                    printf(" %d * ",i);

          }

          sum=sum+fact;

          printf(" = %d",sum);

          getch();

}

 

OUTPUT :

ENTER NO: 5

1 * 2 * 3 * 4 * 5 * = 120

Posted Date: 9/10/2012 2:09:45 AM | Location : United States







Related Discussions:- C program to check factorial, Assignment Help, Ask Question on C program to check factorial, Get Answer, Expert's Help, C program to check factorial Discussions

Write discussion on C program to check factorial
Your posts are moderated
Related Questions
Write a program to find the area under the curve y = f(x) between x = a and x = b, integrate y = f(x) between the limits of a and b. The area under a curve between two points can b

i need expression and its types with example programs in c++

hello i have about 15 hours the dead line I Need a program in c language that''s determine the router ip or the gateway ip of the current NIC example the router ip is: 192.168.1.1

In which condition a template a better solution than a base class? A: While you are designing a generic class to contain or manage objects of other types, while the format & beh

Bit-wise Operators Some applications require operations to be done on dissimilar bits of a byte separately. Bit-wise operators offer a facility to do just that. There are vario

A palindrome is a string that reads the same from both the ends. Given a string S convert it to a palindrome by doing character replacement. Your task is to convert S to palindrome

What is conversion constructor? explain it .

FUNCTIONS It refers to a subprogram that is meant to do a certain task. It is basically used to execute a set of operations and return information to the main or calling functio

I need Asp .net Facebook app project completion Project Description: We are urgently seeking a few remaining items to be completed, and the project to be deployed to live.

Write a function that takes in a radius and evenly covers the screen with circles of that radius. Don't attempt to draw any circles that are completely off the screen.