Using namespace std; int main {


Download 119.54 Kb.
Sana10.03.2020
Hajmi119.54 Kb.

8)

#include

#include
using namespace std;
int main() {

int n = 1;

double eps, s = 0, q, x ;

cout << "vvedite epselon\n\t";

cin >> eps;

cout << "vvedite x = ";

cin >> x;

do {


q = pow(x, n) / sqrt(n);

k++;


cout << q << endl;

} while (fabs(q) >= eps);



cout << s;
return 0;

}



#include

#include

using namespace std;

int main() {

int k = 1;

double eps, s=0, q ;

cout << "vvedite epselon\n\t";

cin >> eps;

do {


q = 1 - (1 / pow(k, 2));

s += q;


k++;

cout << q<

} while (fabs(q) >= eps);

cout << s;



return 0;

}


Download 119.54 Kb.

Do'stlaringiz bilan baham:




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2020
ma'muriyatiga murojaat qiling