Write a java program to print the series S=1/2+1/3+1/4+1/5+1/6+1/7+1/8+1/9+1/10+1/11+1/12+1/13+1/14+1/15 and also find the value of 'S'.
plzzzz answer fast!!!
Answers
Answered by
4
Answer:
class Sum
{
void main()
{
int i = 1, S = 0;
for (; i <= 15; i++)
{
S += 1 / i;
}
System.out.println("The sum of the given series is " + S);
}
}
Answered by
0
Answer:
class sum_series
{public static void main (string arts[])
{ int S=0;
for(int i =1;i<=15;i++)
S=S+(1/i);
System.out.println("S:"+S);
}
}
Similar questions