Taking a CS class, but struggling with bools (other functions I can handle)
This is supposed to detect if a number is the power of two, I played around with it a lot but no matter what its not working ( I think I had it almost there but then I changed it) now it looks like this
void GetValues(int &);
bool mathstate(int);
int main()
{
int n;
cout << "This program determines if a number, input by you, is a power of 2" << endl;
cout << "You will be prompted for a number" << endl;
GetValues(n);
bool result = mathstate(n);
if (result == true)
{
cout << n << " is power of 2" << endl;
}
if (result == false)
{
cout << n << " is not power of 2" << endl;
}