Write a program that reads in exactly 10 integers and outputs the sum.
What will be an ideal response?
```
```#include
//loop to accept 10 integers and sum
int main()
{
using namespace std;
int x, sum = 0;
cout << "Enter 10 integers, each followed by
<< " I will give the sum." << endl;
for(int i =0; i < 10; i++){
cout << "Enter integer " << i << ": ";
cin >> x;
sum = sum + x;
}
cout << "sum: " << sum << endl;
return 0;
}
You might also like to view...
Lambda expressions implement __________.
Fill in the blank(s) with the appropriate word(s).
The ________ property provides literal characters that are typed for each entry.
A. Validation Rule B. Default Value C. Validation text D. Input Mask
____________________ means that one person's work serves as a complementary check on another person's actions.
Fill in the blank(s) with the appropriate word(s).
Which area of AI research projects a person into a sensation of three-dimensional space?
A) Genetic algorithms B) Neural networks C) Robotics D) Virtual reality E) None of the above