Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream> //exercise 12, counting big sqrt
- using namespace std;
- double moreSqrt(int n, int m = 1)
- {
- if (m == n)
- return 1;
- else
- return sqrt(1 + (m + 1) * moreSqrt(n, m + 1));
- }
- int main()
- {
- int n;
- cout << "Enter the value of N: ";
- cin >> n;
- cout << "Your big sqrt is " << moreSqrt(n) << endl;
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement