// program to report the number of characters entered up to the first period // not counting the terminating period. #include using namespace std; int main() { int howMany; char c; // using a while loop cout << "Enter a character ('.' to stop) -- "; cin >> c; howMany = 0; while (c != '.') { howMany++; cout << "Enter a character ('.' to stop) -- "; cin >> c; } cout << "You entered " << howMany << " characters." << endl; // using a do-while loop howMany = 0; do { cout << "Enter a character ('.' to stop) -- "; cin >> c; if (c != '.') howMany++; } while (c != '.'); cout << "You entered " << howMany << " characters." << endl; return 0; }