C# Corner
Tech
News
Videos
Forums
Trainings
Books
Live
More
Interviews
Events
Jobs
Learn
Career
Members
Blogs
Challenges
Certifications
Bounties
Contribute
Article
Blog
Video
Ebook
Interview Question
Collapse
Feed
Dashboard
Wallet
Learn
Achievements
Network
Refer
Rewards
SharpGPT
Premium
Contribute
Article
Blog
Video
Ebook
Interview Question
Register
Login
Java Array Average Program
WhatsApp
Alagunila Meganathan
Jul 28
2016
860
0
0
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
Up Next
Java Array Average Program