Write a program to calculate average of three subject marks and print the grade.

public class Avg
 {
    public static void main(String args[])
     {
                 int avg=0;
                 int mrk1=Integer.parseInt(args[0]);
                 int mrk2=Integer.parseInt(args[1]);
                 int mrk3=Integer.parseInt(args[2]);
                 avg=(mrk1+mrk2+mrk3)/3;
                 System.out.println("the avg of marks are ="+avg);
        if(avg>=90)
                   System.out.println("grade of the student is AA");        
         if(avg>=80)                    
                         System.out.println("grade of the student is AB");  
         if(avg>=70)
                     System.out.println("grade of the student is BB");                  
         if(avg>=60)
                  System.out.println("grade of the student is BC");
         if(avg>=50)
                  System.out.println("grade of the student is CC") ;
         if(avg>=40)
                       System.out.println("grade of the student is CD");                            
         if(avg>=30)
                  System.out.println("grade of the student is DD");         
         if(avg<=29)
                  System.out.println("grade of the student is fail");        
            } 
                       

}