Logic :-
Logic is very simple you need to use one for loop and initialize with 1 and run into numbers of terms condition and increase by multiply of condition like i*=2 and print the value of i .
or sum=sum+i; this statement print the sum of the series .
Output:
Enter The Number Of Terms
256
Series I sGiven Below
1 2 4 8 16 32 64 128 256
Sum Of Above Series Is
511
need an explanation for this answer? contact us directly to get an explanation for this answer