Subscribe

RSS Feed (xml)

Wednesday, February 17, 2010

Write a C program to find the exponential series of 1+x+x2/2!+x3/3!+.......+xn/n!

#include< math.h>
void main( )
{
int x, n, fact, i, j;
float sum=1;
clrscr( );
printf("Enter the 'x' value:");
scanf("%d",&x);
printf("\nEnter the 'n' value:");
scanf("%d",&n);
for(i=1; i< =n ; i++)
{
fact=1;
for( j=i ; j >=1; j--)
fact=fact*j;

sum=sum+(pow(x,i )/ fact);
}
printf("\nSum of the series : %f ",sum);
getch( );
}

Note:- If any errors,, plz mail to me.

27 comments:

  1. can u please give this code
    1! + 2! + 3! + 4!


    Thanks,
    shweta

    ReplyDelete
    Replies
    1. #include
      #include

      void main()
      {
      int num,i,fac=1;
      printf("Enter The Number Of Which You Want Factorial ");
      scanf("%d",&num);

      for(i=1;i<=num;i++)
      {
      printf("num=%d\n",i);
      fac*=i;
      }
      printf("Factorial = %d",fac);
      }

      Delete
    2. main()
      { int no,fac=1,i=1;
      int long sum=0;
      printf("enter no of terms);
      scanf ("%d",no);
      for(i=1; i<=no ;i++)
      { fac*=i;
      sum=sum+fac;
      }
      printf("sum of fac seriese=%ld",sum);
      return 0;
      }




      }

      Delete
  2. 1+x+x2/2! ---xn/n! program res is 0
    why i will given x=3 n =2 so res is=0

    canu chnage the program mail me nrk043@gmail.com

    ReplyDelete
  3. please help me to find logic of the series

    1,3,6,11,20,37........

    if any one solve this problem please mail me logic code in
    supriyamuni@gmail.com

    ReplyDelete
  4. what is the right state ment of x = x + y =<30

    ReplyDelete
  5. Get easy Free Hindi Ebooks of Programming Languages PHP,JAVA, HTML5 and CSS3,JAVASCRIPT,JQUERY,C,C++,C#(SHARP),DATA STRUCTURE,VB6 etc.

    Get,Learn & Do & Earn Huge Income.
    For get the ebooks free in pdf format,click on below link:

    Free Downloads Ebooks of Programming Languages in Hindi in pdf format

    ReplyDelete
  6. Some important c pgms
    http://www55.zippyshare.com/v/96361476/file.html

    ReplyDelete
  7. Good stuff..
    well explanation of basic points.

    ReplyDelete
  8. Its simply superb.Feeling good to share the link to practice. Thanks

    ReplyDelete
  9. Great post. Its pretty useful..
    you can find more than 100 basic programs here : c programs

    My latest blog post : Best c compiler for windows
    c programming in linux

    ReplyDelete
  10. For Best C Programs with Full Explanatons..
    Visit Here ►► Lightning Code

    ReplyDelete
  11. This comment has been removed by the author.

    ReplyDelete
  12. Here is blog for basic C and C++ programs
    List of C and C++ Programs

    C and C++ based programs

    ReplyDelete
  13. C tutorial with free and simple example on Data Types & Variables, Conditionals, Loops, Arrays & Strings etc. Here you can download simple and easy online c tutorial for beginners .C Programming online test.

    ReplyDelete
  14. Nice Blog. To see more interesting C programs visit:

    http://cprogrampracticals.blogspot.in/

    ReplyDelete
    Replies
    1. C programs given on following link are interesting:

      http://cprogrampracticals.blogspot.in/p/special-c-programs.html

      Delete
  15. C program basics given on following link are good:

    http://cprogrampracticals.blogspot.in/p/basic-concepts.html

    ReplyDelete
  16. Very Informative article you have described everything in a brilliant way. This is really useful arrticle for begginer learner. Appreciated!

    buffalo web design service is available in a proper way. You can develop your website in reasonable from Crystal Tech Solution.

    ReplyDelete
  17. i found your article very intresting. really nice post. keep posting this type of important post. lots of love from rajasthan
    also help me to improve my backlinking i am adding my website link.
    Tramadol 50mg

    ReplyDelete