I changed the while to a do-while, took out that extra cin statement and everything is fine EXCEPT it outputs this
Enter a decimal integer to convert it to binary: -1080046200
-1080046200 is not a positive integer. //not one of my inputs
32
Enter a decimal integer to convert it to binary: 32
32 (base 10) = 100000 (base 2).
2
Enter a decimal integer to convert it to binary: 2
2 (base 10) = 10 (base 2).
-3
Enter a decimal integer to convert it to binary: -3
-3 is not a positive integer.
6
Enter a decimal integer to convert it to binary: 6
6 (base 10) = 110 (base 2).
//manip.cpp --- using format manipulators
#include <iostream>
int main()
{
usingnamespace std;
cout << "Enter an integer: ";
int n;
cin >> n;
cout << "n\tn*n\n";
cout << n << "\t" << n * n << " (decimal)\n";
//set to hex
cout << hex;
cout << n << "\t" << n * n << " (hexadecimal)\n";
//set to octal
cout << oct << n << "\t" << n*n << " (octal)\n";
//alternative way to call manipulator
dec(cout);
cout << n << "\t" << n * n << " (decimal)\n";
return 0;
}