hi
here is a program for exponential but it desn,t work properly pls tell me the correction
Code:
#include<stdio.h>
#include<conio.h>
float expo(float,float,int,float);
float term(float,float,float);
main()
{
 int n;
 float e=0.0,t=1.0,x,s=1.0;
 clrscr();
 printf("\nenter variable & no ofterms:=");
 scanf("%f%d",&x,&n);
 e=expo(x,t,n,s);
 printf("\nsum=%f",e);
 getch();
 return;
}
float expo(float x,float t,int n,float s)
{
 float c=1.0,e=0;
 if(t<n)
 {
  e=term(x,t,c);
  s=s+e;
  expo(x,t+1.0,n,s);
 }
  return(s);
}
float term(float x,float t,float c)
{
 if(t>=1)
 {
  c=c*(x/t);
  term(x,t-1,c);
 }
  return(c);
}

Last edited by shabbir; 27Feb2010 at 09:52.. Reason: Code blocks