Answered step by step
Verified Expert Solution
Question
1 Approved Answer
C++ please and thank you s is a txt file that contains integers. Why do I keep on getting 0 for the minimum value when
C++ please and thank you
s is a txt file that contains integers. Why do I keep on getting 0 for the minimum value when I use the following code?
void minimum(string k) {
my_input_file.open(k);
while (my_input_file >> value) {
minimum = min(minimum, value);
my_input_file.close();
}
cout << "min " << minimum;
}
int main(){
string k =(" file.txt")
minimum(k)
}
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