diff --git a/a2/program.c b/a2/program.c new file mode 100644 index 0000000..cbd43f4 --- /dev/null +++ b/a2/program.c @@ -0,0 +1,29 @@ +#include +#include +#include +// Please implement the header file from the assignment to fulfill the unit tests.. + // You can add any function +#include "pangram.h" + + +bool is_pangram(const char *sentence) { + char alphabet[] = "abcdefghijklmnopqrstuvwxyz"; + char is_char_contained[] = "00000000000000000000000000"; + for (int i = 0; i < sizeof(sentence); i++) { + int iterator = 0; + for (int l = 0; l< 26; l++) { + if (sentence[i] == sentence[iterator]) { + is_char_contained[iterator] = 1; + break; + } + iterator++; + } + } + + for (int i = 0; i<26;i++) { + if (is_char_contained[i] == 0) return 0; + } + return 1; + + return 0; +}