man, am I tired
sorry bout a the posts.
# include <iostream>
using namespace std;
void main ()
{
int lowest = 0;
int number = 0;
cout<<"Enter in the number"<<endl;
cin>>number;
lowest = number;
for(int count =0; count < 3; count++)
{
cout<<"Enter in the number"<<endl;
cin>>number;
if(number < lowest)
lowest = number;
}
cout<<lowest;
}
"Randi" <RSaddler@stny.rr.com> wrote in message news:...
Whoa there,
I am not a kid trying to get an answer for an assignment. I am a 38 year
old student taking my required C++ class for my IT degree. I am also a
member of Phi Theta Cappa with a 3.8 GPA, trying to study for an exam
tomorrow. These are practice problems to help us study. Here is my code
for the for loop. How would you make this work taking input from a file.
Thanks,
Kelsey
"Victor Bazarov" <v.Abazarov@comAcast.net> wrote in message
news:bohsb.128304$9E1.638773@attbi_s52...
"Randi" <RSaddler@stny.rr.com> wrote...
I am having problems with this question: Write a C++ while statement
that
will input numbers from a file until the end of file is reached.
Output
the
lowest number in the file.
There is no question here. It looks much more like an assignment.
Have you tried asking your teacher about it?
Ok, I do understand the logic, I believe the following for loop solves
it
from keyboard input.
Which "following for loop" are you talking about?
But how do you point to any given value from a file.
You can't assign anything to a variable. Little lost on this one.
To input something from a file you need to open a file. Read about
ifstream class in your textbook.
Victor
.