#include #include using namespace std; void print(int start, int end, int stride); int main() { print(4, 12, 2); //Print the even integers from 4 to 12 inclusive. return EXIT_SUCCESS; } //Print the integers from start to end inclusive by stride's. void print(int start, int end, int stride) { if (start > end) { cerr << "start " << start << " can't be bigger than end " << end << "\n"; exit(EXIT_FAILURE); } if (stride <= 0) { cerr << "stride " << stride << " must be positive\n"; exit(EXIT_FAILURE); } cout << start << "\n"; if (start < end) { print(start + stride, end, stride); } }