TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
C# Corner
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Calculate The Serious Of Number Program Using Java
Senthilvelan Sambamoorthy
Aug 12
2016
Code
436
0
0
facebook
twitter
linkedIn
Reddit
WhatsApp
Email
Bookmark
expand
ssva01.rar
// series of number program
import
java.io.*;
import
java.lang.*;
public
class
ssva01
{
public
static
void
main(String arg[])
throws
IOException
{
float
n,i;
float
a;
BufferedReader inp=
new
BufferedReader(
new
InputStreamReader(System.in));
System.out.print(
"\n\nEnter the value of N: "
);
n=Float.parseFloat(inp.readLine());
a=
0
;
for
(i=
1
;i<=n;i++)
{
a=a+(
1
/i);
}
System.out.println(
"Series of numbers: "
+a);
}
}
Java