Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cstring>
- #include <cctype>
- using namespace std;
- int main()
- {
- const int SIZE = 5;
- char input[SIZE];
- char alphaCount = 0;
- cout << "Enter five characters: " << endl;
- cin.get (input, SIZE);
- for (int count = 0; count < SIZE; count++)
- {
- if (!isalpha(input[count]))
- alphaCount += 1;
- }
- cout << "The number of alphabetic characters your input contains is " << alphaCount << endl;
- system("pause");
- cin.ignore();
- cin.get();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement