Write a program for the following series using Scanner class.
Attachments:
Answers
Answered by
0
public class Series
{
public static void main(String args[ ])
{
int a;
for(a=1;a<=5;a++)
{
s = s + 1/a;
}
System. out. println(" The sum of the series= " +a);
}
}
{
public static void main(String args[ ])
{
int a;
for(a=1;a<=5;a++)
{
s = s + 1/a;
}
System. out. println(" The sum of the series= " +a);
}
}
Similar questions
Math,
7 months ago
Computer Science,
7 months ago
Chemistry,
7 months ago
Math,
1 year ago
Social Sciences,
1 year ago