write a program to print the sum of given series (1)3 + (2)3 + (3)3...........(10)3
I want the program in java
Answers
Answered by
0
Answer:
Input: a = 3, n = 3
Output: 0.6666667
The series is 1/3 + 1/9 + 1/27 which is
equal to 0.6666667
Input: a = 5, n = 4
Output: 0.31039998
Answered by
0
Hi,
I have attached the code below.Hope it helps.Happy coding...
class brainly
{
public static void main()
{
int x = 1;
int y = 3;
int s = 0;
while(x!=10)
{
s = s+(x*y);
x++;
}
System.out.println(x*y);
}
}
Similar questions