Computer Science, asked by Nightmonster2, 10 months ago

Write a program in java to print the series upto 10 terms:
1/3+1/5+1/7......

Answers

Answered by Anonymous
1

Question:

Write a program in java to print the series upto 10 terms:

1/3+1/5+1/7......

Answer:

import java.util.*;

public class Series

{

public static void main(String args[])

{

Scanner in =new Scanner(System.in);

int a,b=1,c,d=0;

for(a=1;a<=10;a++);

for(c=3;c<=23;c=c+2);

{

d=b/c+d;

System.out.println("The series is="+d);

}

}

}

Explanation:

Using for loop because the program is repeated for several times and it makes program short.

For more java programmings follow the given links.:

brainly.in/question/14797688

brainly.in/question/16088835

brainly.in/question/16195360

Similar questions