Skip to content

Sksanjay12/Average-array-program-in-java

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

2 Commits
ย 
ย 
ย 
ย 

Repository files navigation

Array Average and Count Program

๐Ÿ“Œ Overview

This Java program:

  • Takes an integer x as input (size of the array).
  • Reads x integers into an array.
  • Prints all the entered integers.
  • Calculates the average of the array values (formatted to 2 decimal places).
  • Counts how many integers are less than the average and prints the result.

๐Ÿ› ๏ธ How to Run

  1. Save the code in a file named main.java.
  2. Compile the program:

Input: 5 10 20 30 40 50

Output: 10 20 30 40 50 Average = 30.00 Count of numbers less than average = 2

About

To count the number of integers in a array is less than the average of the array.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages