fork download
  1. #include <iostream>
  2. using namespace std;
  3. int main()
  4. {
  5.  
  6. std::cout << "Enter two numbers: " << std::endl;
  7. int a,b;
  8. std::cin >> a >> b;
  9.  
  10. for (int i = a+1; i < b; i++)
  11. {
  12. cout << i << endl;
  13. }
  14.  
  15. for (int i = a-1; i > b; i--)
  16. {
  17. cout << i << endl;
  18. }
  19.  
  20. return 0;
  21. }
Success #stdin #stdout 0s 3460KB
stdin
1 10
stdout
Enter two numbers: 
2
3
4
5
6
7
8
9