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.
1
Expert's answer
2014-04-10T10:23:03-0400
#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; }
Comments
Leave a comment