Write a C++ program that reads four double precision numbersfrom the screen using the variables x1,x2,x3 and x4. The programthen adds them together multiplies the sum by the quantityx1*x2*x3*x4 and then prints the final result to the screen withappropriate label.

Respuesta :

Answer:

#include <bits/stdc++.h>

using namespace std;

int main() {

  double x1,x2,x3,x4,sum,output;//declaring variables..

  cout<<"Enter the variables"<<endl;

  cin>>x1>>x2>>x3>>x4;//taking input of the time...

  sum=x1+x2+x3+x4;//calculating the sum...

  output=sum*x1*x2*x3*x4;

  cout<<"The asnwer is "<<output<<endl;//printing the temperature..

return 0;

}

Explanation:

I have taken 6 double variables sum to hold the sum of variables and output is to hold the answer.Then calculating printing the output.