-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathavgmarks.java
More file actions
27 lines (25 loc) · 937 Bytes
/
Copy pathavgmarks.java
File metadata and controls
27 lines (25 loc) · 937 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.lang.System;
import java.util.Scanner;
class avgmarks{
public static void main(String[]args){
Scanner scan=new Scanner(System.in);
System.out.print("Enter the marks for first subject: ");
int s1=scan.nextInt();
System.out.print("Enter the marks for second subject: ");
int s2=scan.nextInt();
System.out.print("Enter the marks for third subject: ");
int s3=scan.nextInt();
System.out.print("Enter the marks for fourth subject: ");
int s4=scan.nextInt();
System.out.print("Enter the marks for fifth subject: ");
int s5=scan.nextInt();
int avg=(s1+s2+s3+s4+s5)/5;
System.out.println("Average is "+avg);
if((s1+s2+s3+s4+s5)/5<35){
System.out.print("Additional class required");
}
else{
System.out.print("you are good to go");
}
}
}