fork download
  1. #include<iostream>
  2.  
  3. int main() {
  4. const unsigned limit = 8;
  5.  
  6. std::cout << "Enter " << limit << " integers.\n";
  7.  
  8. int product = 1;
  9. for (unsigned i = 0; i < limit; ++i)
  10. {
  11. int value;
  12. std::cin >> value;
  13. product *= value;
  14. }
  15.  
  16. std::cout << "The product of those " << limit << " numbers is " << product << '\n';
  17. }
Success #stdin #stdout 0s 3460KB
stdin
1 2 3 4 5 6 7 8
stdout
Enter 8 integers.
The product of those 8 numbers is 40320