Skip to main content

Posts

Showing posts from March, 2020

C++ Programme for e^x

#include<iostream> using namespace std; int main() { float x,term,e; cout<<"Give me x of e^x in eq= "; cin>>x; term=1; e=term; for(int i=0;i<=1000;i=i+1) { term=term*x/(i+1); e=e+term; } cout<<"e^"<<x<<"="<<e; }

All Gmails

Sayantan Datta Shuvradeep Datta Himadri Sekhar Datta Janhabi Datta sdatta9771@gmail.com hsdatta9771@gmail.com sddatta505@gmail.com shuvradeep.datta17@gmail.com sddattaofficial@gmail.com sddatta55@gmail.com sddattagamer@gmail.com sddatta506@gmail.com sddatta507@gmail.com sddatta508@gmail.com deepdatta@gmail.com sdatta_ece@gmail.com

C++ Programme for Newton Forward Interpolation

#include<iostream> #include<fstream> #include<math.h> #include<cmath> #include<bits/stdc++.h> using namespace std; int main() { double x[100],y[100][100],h,term,t,xr,sum; int i,n,j,k=0; char filename[20]; cout<<"Give me the name of the output file name:"; cin>>filename; ofstream f(filename); std::ifstream input("input.txt"); cout<<"Give me the value of x in sin x"; cin>>xr; while(!input.eof()) { k=k+1; input>>x[k]>>y[k][0]; } n=k-1; h=(x[2]-x[1]); t=(xr-x[1])/h; term=t; sum=y[1][0]; for(i=1;i<=n;++i) { cout<<x[i]<<"\t"<<y[i][0]<<"\n"; } for(i=1;i<=n;++i) { for(j=1;j<=n-i;++j) { y[j][i]=y[j+1][i-1]-y[j][i-1]; } } cout<<"The Difference Table is:\n"; f<<"The Difference Table is ::\n"; for(i=1;i<=n;++i) { cout<<setw(4...