Program to input marks and print the grade according to the given criteria JAVA


Write a Program to input marks and print the grade according to the given criteria.




import java.util.*;
class grades
{
    public static void main(String args[])
    {
        Scanner sc = new Scanner(System.in);
        int marks = sc.nextInt();
        if(marks>80)
        System.out.println("A grade");
        else if(marks>=60 && marks<=80)
        System.out.println("B grade");
        else if(marks>=50 && marks < 60)
        System.out.println("C grade");
        else
        System.out.println("D grade");
    }
}



     
                     

Contact Us

REACH US

SERVICES

  • CODING
  • ON-LINE PREPARATION
  • JAVA & PYTHON

ADDRESS

B-54, Krishna Bhawan, Parag Narain Road, Near Butler Palace Colony Lucknow
Contact:+ 919839520987
Email:info@alexsir.com