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

i want a c or c++ code for solving transportation problem using modified distribution method


Problem 1 What is the difference between function declaration and function definition? 2 Write a recursive function to find sum of even numbers from 2 to 10. 3 List some


We are seeking a talented developer/team with great experience in programming apps for both Android and iOS. Our project needs great skills and experience in making good functional

finds the average for all assignments for an individual student float getAverageForStudent(float scores[20][10], int student, int numAssignments) {  }  // finds the average for

The for Loop For loop is the controlled form of loop. The general format of this : for( initialize ; test ; update)                  {                     statements;

Networking program development. 1.ARP protocol. 2.Switching HUB. 3.wireshark. 4.winpcap library. 5.C++ & MFC. 6.LAN evironment through switch and HUB(static ARP t

A: Method of passing arguments to a function that takes parameter of type reference.  for instance: void swap( int & x, int &amp;amp; y ) { int temp = x; x =