-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathARRAYS.java
More file actions
21 lines (18 loc) · 759 Bytes
/
ARRAYS.java
File metadata and controls
21 lines (18 loc) · 759 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import java.util.*;
public class ARRAYS {
public static void main(String args[]) {
int marks[] = new int[100]; // array declaration datatype name[]=new int []
Scanner sc = new Scanner(System.in);
marks[0] = sc.nextInt();
marks[1] = sc.nextInt();
marks[2] = sc.nextInt();
System.out.println("physics=" + marks[0]);
System.out.println("Chemistry" + marks[1]);
System.out.println("Math" + marks[2]);
marks[2] = 1000;// updation array
int percentage = (marks[0] + marks[1] + marks[2]) / 3;
System.out.println("math" + marks[2]);
System.out.println("percentage" + percentage);
System.out.println("length is=" + marks.length);
}
}