Loop Program Print Series 1 2 4 8 16 32 64 in C++


Write a for loop that prints the values 1 2 4 8 16 32 64 by increasing the value of a counting variable by a factor of two in each cycle?


for (int num = 1; num <= 64; num *= 2)
cout << num << “ “;