#include using namespace std; int main() { int i{0}; int startValue{0}, endValue{0}; cout << "Enter an end value: "; cin >> endValue; i = 1; while ( i <= endValue ) { cout << i << " "; i++; } cout << endl; cout << "In reverse" << endl; i = endValue; while( i > 0) { cout << i << " "; i--; } cout << endl; cout << endl; cout << "Enter the start value: "; cin >> startValue; if (startValue >= endValue) { i = startValue; while ( i >= endValue) { cout << i << " "; i--; } } else { i = startValue; while (i <= endValue) { cout << i << " "; i++; } } cout << endl; return 0; }