-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIfElseIfExample.java
More file actions
39 lines (37 loc) · 984 Bytes
/
IfElseIfExample.java
File metadata and controls
39 lines (37 loc) · 984 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
32
33
34
35
36
37
38
39
package com.company;
import java.util.Scanner;
public class IfElseIfExample {
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
System.out.println("Please Enter Your Marks : ");
int marks= sc.nextInt();
if (marks<50)
{
System.out.println("Fail");
}
else if (marks>=50 && marks<60)
{
System.out.println("D Grade");
}
else if (marks>=60 && marks<70)
{
System.out.println("C Grade");
}
else if (marks>=70 && marks<80)
{
System.out.println("B Grade");
}
else if (marks>=80 && marks<90)
{
System.out.println("A Grade");
}
else if (marks>=90 && marks<100)
{
System.out.println("A++ Grade");
}
else
{
System.out.println("Invalid !");
}
}
}