Friday, October 7, 2022

Exp #2

 #include <iostream>

#include <math.h>

using namespace std;

int main()

{

double x,s,a,b,c;

cin >> x;

cout << x << " " << exp(x) <<" ";


s = 1; a = x; b = 1; c = x;

for (int i = 1; i < 1000; i++)

{

s = s + c;

c = c * x;

c = c / (i + 1);

}

cout << s << "\n";

}

No comments:

Post a Comment

Basic Comparison of C++ and HTML/JavaScript

 Here’s a basic comparison of C++ and HTML/JavaScript for common programming concepts and  simple code examples for each. This will help ...