#include"../../std_lib_facilities.h"
int main(){
vector<double>myval;
double numb;
double smallest=0.0,largest=0.0;
double total_distance=0.0;
cout<<"Please Enter the Values:\n";
while(cin>>numb)
{
myval.push_back(numb);
}
for(int i=0;i<myval.size();i++)
{
total_distance=total_distance+myval[i];
if(myval[i]<=smallest)
smallest=myval[i];
else if(myval[i]>=largest)
largest=myval[i];
cout<<myval[i]<<"\n";
}
keep_window_open();
}
The Program Gets Teriminated if we give any character.but it should come out of the loop rather than terminating.
While it is terminated .The program exits .Please help me



LinkBack URL
About LinkBacks



