0

Can somebody tell me the code for:

a-(a^3(power of 3)/a)+a^5/a-a^7/7........n

The code has to contain only for, if, while and other basic statements....please help me!

2
Contributors
1
Reply
2
Views
9 Years
Discussion Span
Last Post by javaAddict
0

For calculating the sum try something like this:

1+2+3 + ... + i + ..

int sum = 0;

for (int i=1;i<N;i++) {
  sum = sum + i;
}

Also there is this method: Math.pow(a,b) .
Calculates the power:
Math(2,3) = 2^3 = 8

Now let's see some code

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.