Skip to content

Instantly share code, notes, and snippets.

@fida10
Created August 11, 2022 02:17
Show Gist options
  • Save fida10/3f712fe3a55a52d68c8233cba8cfa4ba to your computer and use it in GitHub Desktop.
Save fida10/3f712fe3a55a52d68c8233cba8cfa4ba to your computer and use it in GitHub Desktop.
package Fida;
public class basic {
public static void main(String[] args) {
int[] numbers = {23, 231, 64, 7, 324};
int sum = 0;
for(int i = 0; i < numbers.length; i++){
System.out.println(numbers[i]);
sum = sum + numbers[i];
}
System.out.println("The average is: " + sum / numbers.length);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment