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);}}
No comments:
Post a Comment
if you have any doubts, Please let me know.
Your Truly
Shashank Porwal