#include #include int main() { void to_upper_case_string(char *); char string[100]; printf("Enter string: "); gets(string); to_upper_case_string(string); printf("In upper case: %s", string); return 0; } void to_upper_case_string(char *string) { void to_upper_case(char *); int length = strlen(string); for(int i = 0; i < length; i++) { to_upper_case(&string[i]); } } void to_upper_case(char *c) { int within_bounds(int, int, int); if(within_bounds(*c, 'a', 'z')) { *c -= 32; } } int within_bounds(int x, int low, int high) { if(x >= low && x <= high) return 1; return 0; }