I am trying to get a while loop to work only while a number is divided by 2 and stop once the result is 1 but can not quite figure out how to do it. When I run my code using c9.io my loop in infinite. Can you help me figure out how to make the loop finite please? Here is the code that I have so far. I am I allowed to put a while loop into an if statement? How can I print on the screen all of the numbers from the loop? Thank you.
#include <iostream>
using namespace std;
int main ()
This is actually what happened after I ran a number and I am still trying to see how to fix it... can you have a while loop withing a while loop? Thanks