#include using namespace std; // reads 10 integers from keyboard, checks validity of being integer and adds them up int main() { int num, sum, count; sum = 0; //initialize sum cout << "Please enter 10 integers to add up: "; for (count=1; count <= 10; count++) { if (cin >> num ) // read the next number and checks if it is a valid integer { cout << num << " is a valid entry" << endl; sum += num; // add it to the sum if valid } else //else display a message { cout << "entry #" << count << " is an invalid entry" << endl; } } cout << "the sum is: " << sum << endl; return 0; }