summaryrefslogtreecommitdiff
path: root/wk2
diff options
context:
space:
mode:
Diffstat (limited to 'wk2')
-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;