write a loop that lets the user to enter a number. The
number should be multiplied by 10, and the result stored
in the variable product. The loop should iterate as long as
product contains a value less than 100.
#include <iostream>
int main() {
int product = 1, number;
std::cout << "Please enter a number" << std::endl;
std::cin >> number;
for ( ; ; ) {
if ( product > 100 ) {
break;
}
number *= 10;
product= number;
std::cout << product << std::endl;
}
}
Need a fast expert's response?
Submit order
and get a quick answer at the best price
for any assignment or question with DETAILED EXPLANATIONS!
Learn more about our help with Assignments:
C++