Close
Close

create a method mAvg() that will take three number as arguments and return their average

   Abhayverma2535


Answers

  •   

    import java.util.Scanner;

    class Average {

    public static void main (String[] args) {

    Scanner sc = new Scanner (System.in);

    System.out.println(“Enter the number”);

    int a= sc.nextInt();

    int b= sc.nextInt();

    int c= sc.nextInt();

    public int mAvg() {

    int avg = (a+b+c)/3;

    return avg;

    }

    }



Ask Yours
Post Yours
Write your answer