Example & Tutorial understanding programming in easy ways.

Write a program to change the upper case letter to lower case letter

UPPERcase alphabet:

Example-
A,B,C,D,.........,X,Y,Z
All these alphabet is the upper case.
ASCII value for upper case alphabet:
A=65
B=66
C=67
.....
Y=89
Z=90

Lower-case alphabet:

Example-
a,b,c,d,...........,x,y,z
All these alphabet is of lower case.
ASCII value for lower case alphabet:
a=97
b=98
c=99
.....
y=121
Z=122

program-

#include < stdio.h>
int main()
{
char ch;
printf("Enter upper case alphabet");
scanf("%c",&ch);
printf("Its lower case is %c",ch+32);
return 0;
}


output-

Enter upper case alphabet
D
Its lower case is d

Enter upper case alphabet
V
Its lower case is v

-In this program, we take a input of the UPPER case alphabet and try to convert it into the lower case alphabet.
-We use ASCII value to do this.
-Difference between ASCII value of UPPER case and lower case alphabet is 32.
-So 'UPPER_CASE'+32=lower_case




Read More →