#include <iostream>
#include<iomanip>
using namespace std;
int main()
{
int n;
cout << "Enter a positive interger:";
cin >> n;
int a = n / 2;
int b = 3 * n + 1;
cout << "The interger you had enter is:" << n << endl;
while (n != 0 && n % 2 == 0)
{
cout <<"The orbit of"<< n << "is" << a << endl;
}
if (n % 2 != 0)
{
cout << "The orbit of" << n << "is" << b << endl;
}
system("pause");
}
#include<iomanip>
using namespace std;
int main()
{
int n;
cout << "Enter a positive interger:";
cin >> n;
int a = n / 2;
int b = 3 * n + 1;
cout << "The interger you had enter is:" << n << endl;
while (n != 0 && n % 2 == 0)
{
cout <<"The orbit of"<< n << "is" << a << endl;
}
if (n % 2 != 0)
{
cout << "The orbit of" << n << "is" << b << endl;
}
system("pause");
}