Answer to Question #280314 in C++ for taiba

Question #280314

write program to ask user to enter 4 numbers and the output the main of thes mumbers,this program should only use 2 varible


1
Expert's answer
2021-12-16T14:31:26-0500
#include <iostream>

using namspace std;

int main()
{
  double mean = 0;
  for (int i = 0; i < 4; i++) {
    double foo; cin >> foo;
    mean += foo;
  }
  cout << mean / 4;

  return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog