My program returns odd values and refuses to accept input when compiled on online compilers.
Attached please find the source code, an explanation would be appreciated.
#include <iostream>
#include <stdlib.h>
using namespace std;
int main() {
int n;
cin >> n;
cout << hex << n << " ";
cout << oct << n << " ";
cout << dec << n << " ";
}
There are a couple of things you could try. First remove the include of stdlib.h. You're not using anything from this header, plus in a C++ program it really should be <cstdlib>. Next try returning something from main(). Your online compiler may insist on the return value. Other than that, what do you consider odd values?
On-line compilers do not allow to enter values interactively. But they allow to enter values before compilation that will be used as an input from stdio. For example www.ideone.com has a prompt under the edit window pressing which you will get a window for entering stdio input that will be used during run-time of the program.