Answers
Answer:
Explanation:
AT LAST⤵️
/*
Project Type: Brainly Answer
Date Created: 13-02-2021
Date Edited Last Time: ---NIL---
Question Link: https://brainly.in/question/35120227
Question: Write a java program, to calculate the sum of 5 decimal numbers.
Program Created By: atrs7391
Programming Language: Java
Language version (When program created or last edited): jdk-15.0.2
*/
package Brainly_Answers;
import java.util.Scanner;
public class Sum_of_Five_Decimal_Numbers {
public static void main(String[] args) {
Scanner sc = new Scanner (System.in);
System.out.println("Enter 1st decimal number: ");
double n1 = sc.nextDouble();
System.out.println("Enter 2nd decimal number: ");
double n2 = sc.nextDouble();
System.out.println("Enter 3rd decimal number: ");
double n3 = sc.nextDouble();
System.out.println("Enter 4th decimal number: ");
double n4 = sc.nextDouble();
System.out.println("Enter 5th decimal number: ");
double n5 = sc.nextDouble();
System.out.println("The sum = "+(n1+n2+n3+n4+n5));
}
}