c c plus plus java

Saturday, September 10, 2011

C Program For An Exponential Series

Variables used


fact=1,p=1,e=1,x,n,i


Program

#include<stdio.h>
main()
{
int x,n,i;
float fact=1,p=1,e=1;
printf("Enter the values of x & n");
scanf("%d%d",&x,&n);
for(i=1;i<n;i++)
{
p=p*x;
fact=fact*i;
e=e+(p/fact);
}
printf("%f",e);
}
Posted by Blogger at 9:02 AM
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
Labels: c program

No comments:

Post a Comment

Newer Post Older Post Home
Subscribe to: Post Comments (Atom)

Blog Archive

  • ►  2012 (5)
    • ►  March (3)
    • ►  February (2)
  • ▼  2011 (24)
    • ►  December (3)
    • ►  October (3)
    • ▼  September (18)
      • Get Started Basic HTML TAGS
      • PHP Program Syntax
      • Create Database in PHP Mysql
      • Running a PHP Script
      • C Program To Add Two Matrices Using Function
      • C Program To Find Length Of A String
      • C Program To Multiply 2 Matrices
      • C Program To Find Factorial Of A Number Using Recu...
      • C Program To Solve A Quadratic Equation
      • C Program To Convert Decimal To Binary Octal And H...
      • C Program To Find All Prime Numbers From 1 To Infi...
      • An introduction to PHP - Some Basic HTML tags
      • Xampp Free Download And Installation
      • C Program Algorithm To Count Number Of Vowels Blan...
      • C Program For An Exponential Series
      • C Program Read Days And Print In Month Week Day Fo...
      • C Program To Implement Bubble Sort
      • C Program To Find Sum And Average Of N Numbers
Watermark theme. Powered by Blogger.