top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

C: How can I convert uppercase to lowercase and reverse without using any standard function or method?

+3 votes
391 views
C: How can I convert uppercase to lowercase and reverse without using any standard function or method?
posted Jul 8, 2015 by anonymous

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

+2 votes

1) Go through the entire string character by character and check the ascii value of the char.
2) If the ascii value falls in the upper case range, then make it lower case by adding 32
3) If the ascii value falls in the lower case range, then make it upper case by subtracting 32

The upper case letters are in the range 'A' to 'Z' 65 to 90
The lower case letters are in the range 'a' to 'z' 97 to 122 (see ascii tables)

answer Jul 8, 2015 by Sudeep Gopal
...