How to find Average of three numbers

 public class Avg{
      public static void main(String args[]){
            int num1=15;
             int num2=30;
              int num3=45;
             int Avg=(num1+num2+num3)/3;
               System.out.print(Avg);
 }}

No comments:

Post a Comment

How to install java   How to add two numbers in java How to compile the program How to subtract two numbers in java How to multiply two numb...