Practical 2


Aim:- Write a program that calculate percentage marks of the student if marks of 6 subjects are    given.

JAVA Code :-

import java.lang.*;
class pra2
{
   public static void main(String args[])
   {
      int m[]=new int[6];
      int tot=0,pre;

      for(int i=0;i<6;i++)
      {
          m[i]=Integer.parseInt(args[i]);
          tot+=m[i];
      }
      pre=tot/6;
      System.out.println("Presentage = "+pre +"%");
    }
}

Output:-


No comments:

Post a Comment

Programs

Home Aim:- Write a program to convert rupees to dollar. (60rupees=1 dollar). Aim:- Write a program that calculate percentage marks...