Quick actions

cmd+k|ctrl+k

Navigation

Languages

lab 5 task 223

Snippet info

Language

Cpp

Visibility

public

Author

niktyutenko

Created

2018-10-28T08:54:08Z

Updated

2018-10-28T08:54:08Z

#include <iostream>
#include "cmath"
using namespace std;

int main () {
    double n = 0, a = 1;
    cout << "-----------------" << endl;
    while (a > 0.05) {
        a = trunc((1 / (n + 1)) * 1000) / 1000;
        cout << "| A(" << n << ") = " << a << "\t|" << endl;
        n++;
    }
    cout << "-----------------" << endl;
    
    return 0;
    
}
INFO