I need to create a code that reads only a double
and registers in two variables the "lowest so far" and the "largest so far", I can even successfully complete a cycle but after that it prints any value that I enter.
I tried some ways to do a function, go back to looping, but it would get faulty.
while(cin>>num1){
cout << "maior ate agora " << num1 << endl;
cin >> num2;
if(num2 > num1)
cout << "maior ate agora " << num2;
else
cout << "maior ate agora " << num1;
}