-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAliswagJulianaJasmin_Letters_BSCS_Act2.cpp
60 lines (49 loc) · 1.19 KB
/
AliswagJulianaJasmin_Letters_BSCS_Act2.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
// Letter Checker
// Made by Juliana Jasmin D. Aliswag
// BSCS - 1D (STEM)
// October 28, 2020
#include <stdio.h>
#include <ctype.h>
using namespace std;
int checkVowel(char c)
{
char lowerCaseC = tolower(c);
if (lowerCaseC == 'a' ||
lowerCaseC == 'e' ||
lowerCaseC == 'i' ||
lowerCaseC == 'o' ||
lowerCaseC == 'u')
{
return 1;
}
else
{
return 0;
}
}
int main()
{
char word[200];
int index = 0;
printf("\n\n***************************************************");
printf("\n\n* *");
printf("\n\n* Hello! Welcome to Aliswag's Letter Checker! *");
printf("\n\n* *");
printf("\n\n***************************************************");
printf("\n\nPlease Enter a Word: ");
scanf("%s", word);
while(word[index] != '\0')
{
if (checkVowel(word[index]))
{
printf("\n%c is a Vowel Letter\n", word[index]);
}
else
{
printf("\n%c is a Consonant Letter\n", word[index]);
}
index++;
}
printf("\nThank You for Trusting Aliswag's Services!\n");
return 0;
}