aboutsummaryrefslogtreecommitdiff
path: root/mod11c.cpp
diff options
context:
space:
mode:
authorTyler Taormina <[email protected]>2021-11-10 20:32:17 -0800
committerTyler Taormina <[email protected]>2021-11-10 20:32:17 -0800
commita382ab74014c72df793e9e6d055bb1682a219bca (patch)
tree75f9c10287404d24a8c3ce68181e94f04472d2cf /mod11c.cpp
parentcountChar function is working! (diff)
downloadcst116-lab6-till-t-master.tar.xz
cst116-lab6-till-t-master.zip
Complete Lab 6HEADmaster
Tyler Taormina
Diffstat (limited to 'mod11c.cpp')
-rw-r--r--mod11c.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/mod11c.cpp b/mod11c.cpp
index 3e6ef18..2ce45b5 100644
--- a/mod11c.cpp
+++ b/mod11c.cpp
@@ -120,7 +120,19 @@ void isPalindrome ()
void isAlpha ()
{
- cout << " alphabet check" << endl;
+ char str[MAX];
+ int i;
+
+ cout << "Enter a string to test: ";
+ cin >> str;
+
+ for (int i = 0; str[i] != '\0'; i++)
+ {
+ if (!isalnum(str[i]))
+ {
+ cout << str[i] << " is not alphanumeric" << endl;
+ }
+ }
}