-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpracticeques.java
More file actions
28 lines (23 loc) · 780 Bytes
/
practiceques.java
File metadata and controls
28 lines (23 loc) · 780 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
import java.util.Scanner;
public class practiceques {
public static void main(String[] args) {
//1//
Scanner scanner = new Scanner(System.in);
System.out.println("enter marks of three subjects");
int maths,science,english;
System.out.print("maths: ");
maths = scanner.nextInt();
System.out.print("science: ");
science = scanner.nextInt();
System.out.print("english: ");
english = scanner.nextInt();
float avg =( maths+science+english)/3.0f;
if(avg>=40 && maths>=33&& science>=33&&english>=33)
{
System.out.println("congratulations! you have passed");
}
else{
System.out.println("sorry! you have failed");
}
}
}