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

Byteland county is very famous for luminous jewels. Luminous jewels are used in making beautiful necklaces. A necklace consists of various luminous jewels of particular colour. Nec

Verifone pos offline mod vx670 Project Description: I want a programmer who will build custom application for Offline VX670 to collect and save info+pin 1) Press the am


write a static method with one integer parameter, x that returns the value of the polynomial 3x(2)- 7x + 2

i have a project that is due this Wednesday and i was wondering if i can get help in doing it?

program for factorial


With this assignment you will build a toy program that manipulates pointers to integers. You will develop the same main program fragment in both C and Assembler. Thus, you'll get t

For the circuit shown in Figure, verify the p.d. across resistor R3. If the total resistance of the circuit is 100Ω, verify the current flowing by resistor R1. Find also the