summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFudgerboy <91767657+Fudgerboy@users.noreply.github.com>2023-12-06 05:16:21 +0000
committerFudgerboy <91767657+Fudgerboy@users.noreply.github.com>2023-12-06 05:16:21 +0000
commite76f74f34ef44892f1b8329261199b4d12667ad9 (patch)
tree877d6c91e929162ffeb040d1fe0839a52f67c981
parenteedf960be55a351b1f17f65c8b85962e26a4abb9 (diff)
Tue, Dec 5, 2023, 9:16 PM -08:00
-rw-r--r--wk2/sect2/alpha.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/wk2/sect2/alpha.c b/wk2/sect2/alpha.c
index 760a865..33bbfd7 100644
--- a/wk2/sect2/alpha.c
+++ b/wk2/sect2/alpha.c
@@ -7,10 +7,10 @@ int main(void)
{
string word = get_string("Word: ");
int l = strlen(word);
- for (int i = 1; i < l; i++)
+ for (int i = 0; i < l; i++)
{
// If NOT alphabetical
- if (word[i] > word[i - 1])
+ if (word[i] > word[i + 1])
{
printf("No\n");
return 0;