-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPercentage.java
More file actions
27 lines (20 loc) · 758 Bytes
/
Percentage.java
File metadata and controls
27 lines (20 loc) · 758 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import java.util.Scanner;
public class Percentage{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
System.out.println("Enter marks in physics");
int phy= sc.nextInt();
System.out.println("Enter marks in math");
int math= sc.nextInt();
System.out.println("Enter marks in english");
int eng= sc.nextInt();
System.out.println("Enter marks in chemistry");
int chem= sc.nextInt();
System.out.println("Enter marks in Cs");
int cs= sc.nextInt();
sc.close();
float percentage = ((phy+math+eng+chem+cs)/500.0f) *100;
System.out.println("percentage = ");
System.out.println(percentage);
}
}