Question
I have this C++ code #include #include #include using namespace std; double median(std::vector vec){ int size = vec.size(); if(size > 0 ){ std::sort(vec.begin(),vec.end()); int middle
I have this C++ code
#include
#include
double median(std::vector
int middle = size / 2; double median = 0.0; if(size % 2 == 0){ median = (vec[middle] + vec[middle+1]) / (double)2; }else{ median = vec[middle]; } return median; } return 0.0; }
int main(){ bool keep_on=true; while(keep_on){ vector
cout<<"Median: "< int again = 0; while(true){ cout<<"1: Go again?"< this code runs perfectly on other compilers but I am required to use Gnome Terminal 2.7.3 and it shows me this error CPP test test.cpp*** test.cpp:7: instantiated from here test.cpp:7: instantiated from here test.cpp:7: instantiated from here test.cpp:11: instantiated from here test.cpp:8: instantiated from here Can you tell me what this error means? and how to fix it so the code runs on the gnome terminal?
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started