Sazz
| Subject: Series... Tue Mar 25, 2008 1:16 pm | |
| Hey guyz, new to this place.. hoping ill find a solution from some1 here..
Write a program to find the sum of the given series.....
S=1 + 1/a² + 1/a³ ....................... 1/a(to the power of n)
Input values for : a and n
It wud be realli great if sum1 does it fast. cos tomoro is the Computer exam
THanks in advance |
|
anjanavr47 Active member
| Subject: heres the prg Mon Feb 22, 2010 12:05 am | |
| float sum=1.0,x=0.0; for(int i=2;i<=n;i++) { x=1/(Math.pow(a,i)); sum+=x; } System.out.println(sum); |
|