      program operate
      interface operator ( + )
          function upper_case ( old ) result ( new )
            character*20              :: new
            character*20, intent(in ) :: old
            end function upper_case
      end interface
      interface operator ( - )
          function lower_case ( old ) result ( new )
            character*20              :: new
            character*20, intent(in ) :: old
            end function lower_case
      end interface
      character*20  :: string = 'This uses MIXED case'
      print *, " "
      print *, "Base string .. ",   string
      print *, "Upper case ... ", + string
      print *, "Lower case ... ", - string
      print *, " "
      end program operate

      function upper_case ( old ) result ( new )
      character*20              :: new
      character*20, intent(in ) :: old
      new = old
      do i = 1, len_trim(old), 1
         if ( lge ( old(i:i), 'a' ) .and. &
              lle ( old(i:i), 'z' )       )  &
              new(i:i) = achar ( iachar(old(i:i)) - 32 )
      end do
      end function upper_case

      function lower_case ( old ) result ( new )
      character*20              :: new
      character*20, intent(in ) :: old
      new = old
      do i = 1, len_trim(old), 1
         if ( lge ( old(i:i), 'A' ) .and. &
              lle ( old(i:i), 'Z' )       )  &
              new(i:i) = achar ( iachar(old(i:i)) + 32 )
      end do
      end function lower_case
