Showing posts with label arithmetic mean. Show all posts
Showing posts with label arithmetic mean. Show all posts

Sunday, June 21, 2020

Write a program to input numbers and find the arithmetic Mean of these numbers? ( [a+b]/2 )

17)  Write a program to input numbers and find the arithmetic Mean of these numbers? (     [a+b]/2  )

import java.util.*;
public class Arthemetic_mean_5
{
    public static void main(String args[ ])
    {
        Scanner sc = new Scanner (System.in);
        System.out.println("Enter two numbers");
        double a = sc.nextInt();
        double b = sc.nextInt();
        double d = (a+b)/2.0;
        System.out.println("Arithmetic mean = "+d);
    }
}

 jhvghvgk ;nkjn ,nkjhj