-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmarks.java
More file actions
23 lines (20 loc) · 741 Bytes
/
marks.java
File metadata and controls
23 lines (20 loc) · 741 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
//Write a program to understand the nested loop to print marks and rank achieved.
import java.util.Scanner;
public class marks {
public static void main(String[] args){
Scanner sc=new Scanner(System.in);
System.out.println("Enter your marks:");
int marks=sc.nextInt();
if(marks<=100 && marks>90){
System.out.println("You acheived A+");
}else if(marks<=90 && marks>80){
System.out.println("Youy acheived A");
}else if(marks<=80 && marks>70){
System.out.println("You acheived B+");
}else if(marks<=70 && marks>60){
System.out.println("You acheived B");
}else{
System.out.println("You failed");
}
}
}