Total programming newbie here looking for some guidance.
So I have this assignment where I need to write a program that takes numbers from an input file and spits out said numbers factors. The catch is as soon as the read hits a negative number, the program is supposed to break the loop and end, even if there are values in the input file after the negative number.
I tried inserting another "if" statement within the "for" loop to no avail and I don't think changing the statements in the "for" loop would work.
int number ;
// while a. we have been able to read a number from the input stream
// b. and the number is non-negative
while( ( std::cin >> number ) && ( number > 0 ) )
// find the factors of the number and print them out