import java.util.*;
public class Ifelseif
{
public static void main(String[] args)
{
Scanner scan=new Scanner(System.in);
System.out.println("Enter marks");
int marks=scan.nextInt();
if(marks>=90 && marks<100){
System.out.println("A+ grade");
}
else if(marks>=80 && marks<90)
{
System.out.println("A grade");
}
else if(marks>=70 && marks<80)
{
System.out.println("B grade");
}
else if(marks>=50 && marks<70)
{
System.out.println("C grade");
}
else if(marks>=35 && marks<50)
{
System.out.println("D grade");
}else if( marks<35){
System.out.println("FAIL");
}else
{
System.out.println("Invalid!");
}
}
}
public class Ifelseif
{
public static void main(String[] args)
{
Scanner scan=new Scanner(System.in);
System.out.println("Enter marks");
int marks=scan.nextInt();
if(marks>=90 && marks<100){
System.out.println("A+ grade");
}
else if(marks>=80 && marks<90)
{
System.out.println("A grade");
}
else if(marks>=70 && marks<80)
{
System.out.println("B grade");
}
else if(marks>=50 && marks<70)
{
System.out.println("C grade");
}
else if(marks>=35 && marks<50)
{
System.out.println("D grade");
}else if( marks<35){
System.out.println("FAIL");
}else
{
System.out.println("Invalid!");
}
}
}
No comments:
Post a Comment