Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- using namespace std;
- int sumDownby2(int n) {
- if (n <= 1) {
- return n;
- }
- else {
- return n + sumDownby2(n - 2);
- }
- }
- int main() {
- cout << sumDownby2(0);
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement