2
I need to create a code that reads only one double
and register in two variables the "smallest so far" and the "biggest so far", I can even complete a cycle successfully but after that it prints out any value I insert.
I tried some ways how to do a function, go back to looping but would be defective.
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;
}
Put the rest of the code to see if there is an error somewhere else. Something else. When should you stop asking? There is no end.
– Maniero
That’s basically it, except for the statement, double input = 0; double minor = 0; double major = 0;
– Marv
And if the mistake is in it?
– Maniero
Yeah, I edited a few seconds ago :D
– Marv