We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Therefore, The first output value is: (a + 2 ^ 0 + b)
for the next itteration you just add the value of (2 ^ 1 * b) on the previous itteration value. then you just keep adding up to (2 ^ i * b), I is only up to the n value.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Java Loops II
You are viewing a single comment's thread. Return to all comments →
This might help a bit :)
ONLY the first itteration uses the value of a.
Therefore, The first output value is: (a + 2 ^ 0 + b)
for the next itteration you just add the value of (2 ^ 1 * b) on the previous itteration value. then you just keep adding up to (2 ^ i * b), I is only up to the n value.