Output:
Click Here For Java Online Compiler
Solution:
*** Average Of Five Numbers *** Input first number: 1 Input second number: 9 Input third number: 4 Input fourth number: 5 Enter fifth number: 3 Average of five numbers is: 4.4
Click Here For Java Online Compiler
Solution:
import java.util.Scanner; public class AverageOfNumbers { public static void main(String[] args) { Scanner in = new Scanner(System.in); System.out.print("*** Average Of Five Numbers ***" + "\n"); System.out.print("Input first number: "); double num1 = in.nextInt(); System.out.print("Input second number: "); double num2 = in.nextInt(); System.out.print("Input third number: "); double num3 = in.nextInt(); System.out.print("Input fourth number: "); double num4 = in.nextInt(); System.out.print("Enter fifth number: "); double num5 = in.nextInt(); double sum = num1 + num2 + num3 + num4 + num5; System.out.print("Average of five numbers is: " + sum / 5); } }
comment 1 comments:
more_vertnice article in your blog.thank you for sharing useful info.
29 August 2018 at 20:26visit
web programming tutorial
welookups
sentiment_satisfied Emoticon