(Multiples of 2 with an Infinite Loop) Write a program that prints the powers of the integer 2, namely 2, 4, 8, 16, 32, 64, etc. Your while loop should not terminate (i.e., you should create an infinite loop). To do this, simply use the keyword true as the expression for the while statement. What happens when you run this program?
What will be an ideal response?
```
// Program creates an infinite loop.
#include
using namespace std;
int main()
{
int x = 1;
while ( true ) // infinite loop
{
x *= 2;
cout << x << endl;
} // end while
} // end main
```
You might also like to view...
The worst case in linear search is that every element must be checked to determine whether the search key exists, which occurs if the search key ________.
a. is the last array element b. is not present c. is the last array element or is not present d. None of the above.
The tendency to prefer technological solutions over process is referred to as what mindset?
A. Bullet hole B. Magic bullet C. Bulletproof D. Silver bullet
When images are ____, it means that you can greatly reduce or increase their size and they will print with the same level of quality.
A. resolution dependent B. resolution independent C. high resolution D. large resolution
You can view journal entries in a timeline.
Answer the following statement true (T) or false (F)