I'm new to C++ and was trying to write a program that would ask for a number then return its binary form. However I couldn't get it to compile while trying to use integer powers, and had to use a double power function...however got a warning saying that there could be possible loss of data. After running the program a few times it seems to be fine, but how can I avoid the warning? Here is my code:
using namespace std;
cout<<"Please enter a number less than 256:\n";
cout<<"The number you entered was "<<x<<"\n";
cout<<"Its binary form is:\n";
cout<<"\n\nPress enter to continue";
Also, as I am new to C++, I would appreciate any tips/advice you have?