#include<iostream>
#include<stdio.h>
using namespace std;
double e(int x,int n){
double s;
for(n>0;n--;){
s=1+(x/n)*s;
}
return s;
}
int main(){
double result;
result=e(2,6);
cout<<result<<endl;
return 0;
}
Tried printing Taylor Series Using Horner’s Rule by Iteration Method, kept getting the error “Floating Point Exception”,tried making n>=1 in the loop but didnt work. Can someone please help.
New contributor
Bharat Tyagi is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
8