Answer:
#include <iostream>
using namespace std;
int main()
{
int start, end, choice;
cout << "Enter the starting number: ";
cin >> start;
cout << "Enter the ending number: ";
cin >> end;
cout << "Choose a looping statement: " << endl;
cout << "1. for loop" << endl;
cout << "2. while loop" << endl;
cout << "3. do-while loop" << endl;
cin >> choice;
if (choice == 1)
{
for (int i = start; i <= end; i++)
{
cout << i << endl;
}
}
else if (choice == 2)
{
int i = start;
while (i <= end)
{
cout << i << endl;
i++;
}
}
else if (choice == 3)
{
int i = start;
do
{
cout << i << endl;
i++;
} while (i <= end);
}
else
{
cout << "Invalid choice" << endl;
}
return 0;
}