#include #include /* need to include for strlen, strcmp, strcpy functions */ #define SIZE 80 int main() { char word1[SIZE + 1] = "apples"; char word2[SIZE + 1] = "ALIGATORS"; char word3[SIZE + 1]; char word4[SIZE + 1]; int i; strcpy (word3, word1); strcpy (word4, word2); printf ("This way using toupper and tolower functions DOESN'T work!\n\n"); printf ("word 1 is: %s\n", word1); printf ("word 2 is: %s\n", word2); printf ("word 3 is: %s\n", toupper(word3)); printf ("word 4 is: %s\n", tolower(word4)); printf ("\n\nThis way using toupper and tolower functions works:\n\n"); for (i = 0; i < strlen(word1); i++) word3[i] = toupper(word1[i]); for (i = 0; i < strlen(word2); i++) word4[i] = tolower(word2[i]); printf ("word 3 is: %s\n", word3); printf ("word 4 is: %s\n", word4); }