63 215
Assignments Done
99,3%
Successfully Done
In July 2018

Answer to Question #41211 in C++ for Muhammad Lokman Darus

Question #41211
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.
Expert's answer
#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!

Comments

No comments. Be first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions