From c9504e30162c7c9edb0d224dc0b00d08d8015fdb Mon Sep 17 00:00:00 2001 From: Saravanan Date: Sun, 6 Oct 2024 03:40:06 +0100 Subject: [PATCH] Issue Fix --- src/com/.DS_Store | Bin 6148 -> 6148 bytes src/com/array/rotations/ArrayAverage.java | 29 ++++++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 src/com/array/rotations/ArrayAverage.java diff --git a/src/com/.DS_Store b/src/com/.DS_Store index e3f6b962a8d3e515daac87e75f107ef2a74fcc0d..e716a71c54610e9cbd7939b956cfee9e42bcdd01 100644 GIT binary patch delta 96 zcmZoMXfc=|#>B`mu~2NHo}w@d0|Nsi1A_nqLuF37VQ_MOZo$ODm5eNt=dd(SE@z*x rS%HI{Wn;rb#?9;;{2V}in*}+(Gf(Chu>@)XYh{AcESn=l)-VGAYyA~C literal 6148 zcmeHLv2GJV5S9MNA*4w8fD}kH zRQUs_X`!G%d;wn(<;~2R?B>oU6^hV~wENDxZ+G9l^UZoqM5Z+xG>Ga%R6}8mR#BA% z_j4)4if!2f8ku84N0g3+jZQx+utP&|AUJT}9N>4iinsPP%8;D*Hyx|gCohVOG;6ne zqpXLX+NZ0}-5<}t?v$|xcVLZQa<-VSmS7sHK+8n5oN6wa_f~)Uy{?Y#t9QRP4n&7D zKFw}4lr#MGIS(S)^`KxRuJq}c2EK~TW*NuT^5yd4>38*{Fqf-n8PC_Xt-AV@(G1UO zN++m?zOLwl=(@#mbv2)Td%vz8)u_O`acUXQ*Cl?f(pdarO#?i)j8Z!GwXK~)TPe@e z_xtQIslEkVN8?|(zRraGtBB4Cy}7L}dh7SPn)ddmA0N%XSA3r`-hGPY41ay`i8b7( zz@E)fd#D)d;6QL7IPk{-&JQsPV`4E^l+=MrjsU<2%@VklTnCJ~0hn0K714q)Iuxiw zjXh!*9gg7LZg-#|>40UiIIN&?*KtI-b|KDAF{`Uuk zPr-rUz<=d{iQ1iZ3%6wV*22y4UK^tvqHr)TSCk>B>~<^{ycP5R3KHmx`2v_&%oWjs P2tNeGhEN3u{;31k$hgp( diff --git a/src/com/array/rotations/ArrayAverage.java b/src/com/array/rotations/ArrayAverage.java new file mode 100644 index 0000000..fd362c5 --- /dev/null +++ b/src/com/array/rotations/ArrayAverage.java @@ -0,0 +1,29 @@ +package com.array.rotations; + +public class ArrayAverage { + + public static void main(String[] args) { + int n = 10; + int[] arr = new int[n]; + + // Input array elements + System.out.println("Enter the elements of the array: "); + for (int i = 0; i < n; i++) { + arr[i] = 1+i; + } + + // Calculate sum of elements + int sum = 0; + for (int i = 0; i < n; i++) { + sum += arr[i]; + } + + // Calculate average + double average = (double) sum / n; + + // Output the average + System.out.println("The average is: " + average); + + } + +}