Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<cmath>
- using namespace std;
- int main()
- {
- float a1 = 4, a2 = 2, a;
- int n;
- cin >> n;
- for (int i = 3; i <= n; i++)
- {
- a = (a2/n)+(pow(n,2)/a1);
- cout << "a" << i << "=" << a << endl;
- a1 = a2;
- a2 = a;
- }
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement