Logic :-
In This series loop initialize with zero and increase by 2 cause we have to find the sum of the power of 2 odd number so first print odd number then power of 2 after that sum .
i+=2 ( increase by 2 )
i*i ( Power of 2 )
sum+=(i*i); ( sum of odd )
Output:
1^2+3^2+5^2+……+n^2
Enter Value of N :
5
Sum of given series is = 35
need an explanation for this answer? contact us directly to get an explanation for this answer