/* File: upper2.c Change lower case characters to upper case. Alternate while loop */ #include #define MAXLEN 255 void upper_case (char str[]) ; int main() { char m_str[MAXLEN] ; printf("Enter string: ") ; scanf("%[^\n]s", m_str) ; upper_case(m_str) ; printf("Mangled string: %s\n", m_str) ; return 0 ; } void upper_case(char str[]) { int i = 0 ; char c ; while ( (c = str[i]) ) { // assignment! if (c >= 'a' && c <= 'z') { str[i] -= ('a' - 'A') ; } i++ ; } return ; }