Dear C++ forum. I wish to make a series of numbers in a loop for, where each subsequent number equals 2 raised to the power of following natural numbers. I tried with this code, but something goes wrong. Any suggestions please.
In the first iteration of the loop n_bakt will be set to 1. In the iterations that follows n_bakt will stay as 1 because pow(1, i) returns 1 for all values of i.