212k views
5 votes
Write a program that accepts three decimal numbers as input and outputs their sums?​

User Rapaelec
by
5.7k points

1 Answer

6 votes

Answer:

The answer to this question is given below in the explanation section

Step-by-step explanation:

The code is written in C++ language:

// Example program

#include <iostream>

#include <string>

using namespace std;

int main()

{

double number [3];

double addition=0;

for (int i=0;i<3;i++)

{

cout<<"Enter decimal number at position " <<i+1< " ";

cin>>number[i];

addition= addition+ number[i];

}

cout<<"The addition is "<<addition;

}

User Nishit Chittora
by
7.0k points