-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.c
More file actions
37 lines (26 loc) · 1.25 KB
/
main.c
File metadata and controls
37 lines (26 loc) · 1.25 KB
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
#include "stringlib.h"
#include "config.h"
#ifdef RUN_MAIN
int main()
{
char string[] = "Albe i eblA";
char tempBuffer[100];
strcpy(tempBuffer, string);
printf("Number of words in the string %d\n", wordCount(string));
printf("Last Character Index %d\n", findLastCharacterIndex(string, 't'));
printf("First Character Index %d\n", findFirstCharacterIndex(string, 't'));
convertToUpperCase(tempBuffer);
printf("String in Uppercase %s\n", tempBuffer);
convertToLowerCase(tempBuffer);
printf("String in Lowercase %s\n", tempBuffer);
printf("Number of spaces in the string %d\n", countSpace(string));
printf("Number of vowels in the string %d\n", countVowelsInTheString(string));
printf("Occurence of the character '%c' without case sensitive is %d\n", 'a', countCharacterIgnoreCaseSensitive(string, 'a'));
printf("Occurence of the character '%c' with case sensitive is %d\n", 'a', countCharacterCaseSensitive(string, 'a'));
char *reverse = reverseString(string);
printf("Originial string: %s --> Reversed string: %s\n", tempBuffer, reverse);
free(reverse);
printf("Is string '%s' palindrome? %s\n", string, isPalindrome(string) ? "yes" : "no");
return 0;
}
#endif