Write a Java program to store the sales of 10 days and find the total. (ARRAY)
import java.util.*;
public class sales_10 {
public static void main(String[] args) {
Scanner sc = new Scanner (System.in);
int total=0;
System.out.println("ENTER SALES OF ten (10) DAYS : ");
int sales[]= new int[10];
for(int i=0;i<10;i++){
sales[i]=sc.nextInt();
total+=sales[i];
}
System.out.println("TOTAL : "+ total);
}
}
For CODE : CLICK ➡ https://onecompiler.com/java/3yqgn2bh3 (TO FIND OUTPUT)
BY : 🔴ONE THOUGHT TECHNOLOGY🔴