Write a program in java to find sum and average of four numbers.
Answers
Answered by
5
Answer:
Java Program to Calculate Sum & Average of an Array
public class Sum_Average.
int n, sum = 0;
float average;
Scanner s = new Scanner(System.
System. out. print("Enter no. of elements you want in array:");
n = s. nextInt();
int a[] = new int[n];
System. out. println("Enter all the elements:");
Similar questions