0
The output is not correct. Something is wrong with the calculation process. Is there anything wrong with it?
#include <iostream> #include <iomanip> using namespace std; int main() { float x, sum; int i, n,p , s; cin >>p ; while (cin >> n) { for (i=0; i<n; i++){ cin >> s; sum = sum+s; } x= sum/n; cout << fixed << setprecision(2) << x << endl; } return 0; }
1 Answer
0
Write your program in code then attach your code link into the question so that we can run it. Nobody wants to copy your code to run it.