Computer Science, asked by Anubhav9879, 5 months ago

write a program in java to calculate the sum of five decimal numbers​

Answers

Answered by shm0618007jasleen
2

Answer:

  1. public static void main(String[] args)
  2. int num1 =1.1;
  3. int num2 =2.2;
  4. int num3 =3.3;
  5. int num4 =4.4;
  6. int num5 =5.5;
  7. sum =num1+num2+num3+num4+num5;
  8. System.out.println("five decimal numbers is: "+sum);
Answered by lekshmipshine
0

Answer:

Explanation:

CLS

INPUT "ENTER THE FIRST DECIMAL NO";A

INPUT "ENTER THE SECOND DECIMAL NO";B

INPUT "ENTER THE THIRD DECIMAL NO";C

INPUT "ENTER THE FOURTH DECIMAL NO";D

INPUT "ENTER THE FIFTH DECIMAL NO";E

S=A+B+C+D+E

PRINT "THE SUM OF FIVE DECIMAL NUMBERS IS";S

Explanation:

HOPE IT HELPS

Similar questions