#include <stdio.h>
#include <string.h>

int isPalindroom(char a[]) {
    int first = 0, last = strlen(a) - 1;
    while (first < last) {
        if (a[first] != a[last]) {
            return 0;
        }
        first = first + 1;
        last = last - 1;
    }
    return 1;
}

int main(void) {
    int errors = 0, i;
    char* testStrings[] = { "ABBA", "ABA", "maandnaam", "", "ABB", "ABBB", "ABAA"};
    int expectedResults[] = {    1,     1,           1,  1,     0,      0,      0};  
    for (i = 0; i < sizeof testStrings / sizeof testStrings[0]; i = i + 1) {
        if (isPalindroom(testStrings[i]) != expectedResults[i]) {
            printf("Test isPalindroom(\"%s\") FAALT\n", testStrings[i]);
            errors = errors + 1;
        }
    }
    printf("%d tests GEFAALD!\n", errors);
    getchar();
    return 0;
}
