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
Java Array Average Program
Alagunila Meganathan
Jul 28
2016
Code
535
0
0
facebook
twitter
linkedIn
Reddit
WhatsApp
Email
Bookmark
expand
public
class
ArrayAverage{
public
static
void
main(String[] args) {
double
nums[]={
1.0
,
2.3
,
3.4
,
4.5
,
40.5
};
double
result=
0.0
;
int
i=
0
;
for
(i=
0
; i < nums.length; i++){
result=result + nums[i];
}
System.out.println(
"Average is ="
+ result/nums.length);
}
}
Java Array