-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexercise1.java
More file actions
31 lines (26 loc) · 988 Bytes
/
Copy pathexercise1.java
File metadata and controls
31 lines (26 loc) · 988 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
28
29
30
31
import java.util.Scanner;
public class exercise1 {
public static void main(String[]args){
float percentage;
Scanner sc=new Scanner(System.in);
System.out.println("Enter the marks of student");
float sub1,sub2,sub3,sub4,sub5;
System.out.println("Enter the marks of sub1");
sub1=sc.nextInt();
System.out.println("Marks is:" + sub1);
System.out.println("Enter the marks of sub2");
sub2=sc.nextInt();
System.out.println("Marks is:" + sub2);
System.out.println("Enter the marks of sub3");
sub3=sc.nextInt();
System.out.println("Marks is:" + sub3);
System.out.println("Enter the marks of sub4");
sub4=sc.nextInt();
System.out.println("Marks is:" + sub4);
System.out.println("Enter the marks of sub5");
sub5=sc.nextInt();
System.out.println("Marks is:" + sub5);
percentage=((sub1+sub2+sub3+sub4+sub5)/500)*100;
System.out.println("Percentage is;"+ percentage);
}
}