I know I am probably just doing something dumb wrong, but I need to take a number from the user, create an infinite loop (by making my while statement true) of multiples of 2. I got the math to multiply the number from the user times itself, but I can't get it to loop. This is the last part of my homework for the week and my brain is fried, so I can't figure out where I went wrong!
Any help would be amazing! Here is what I have:
#include <iostream>
using namespace std;
int main (int argc, const char * argv[])
{
int d;
int e;
cin >> d;
while (true)
{
e = d * d;
}
cout << e << ", ";
}