By going on sites that are not secure or dowloding thigs
The correct answer is programming
Hope this helps! :)
In my lifetime Face Book has most hurt me. Hackers hacking my account. Saying things I never said and pretending to be me. It disconnected me from my freeinds literally. They never wanted to talk to me. It really was sad.
Answer:
If the input is: 2 3 4 8 11 -1
the output is:
Middle item: 4
To explain the given is as follows,
Explanation:
Code:-
#include <iostream>
#include <vector>
using namespace std;
int main()
{
std::vector<int> v;
int temp, i=0;
cout <<"Enter the sorted elements "<<endl;
while(1){
cout<<"Enter ["<<i<<"]element"<<endl;//Accept elements in a vector
cin >> temp;
i++;
if(temp>0)
v.push_back(temp);
else //If negative number is inputed assume end of input
break;
}
cout<<"Size of a vector is:"<<v.size()<<endl; //Find size of vector
if (v.size() % 2 == 0){
cout <<"NUMBER OF ELEMENTS SHOULD BE ODD";
}
else if(v.size()>9){
cout<<"Too many numbers.";
}
else{
cout<<"Median = " << v[v.size()/2]<<endl; //Find median
}
}
Output: