In this program you will learn how you can convert string from uppercase to lowercase, In C language every character represent as a integer value known as ASCII. ASCII value of small letter (a-z) are (97-122) and capital (A-Z) are (65-90)
#include<stdio.h>
void main()
{
char str[20];
int i;
printf("\n enter a string:");
gets(str);
for(i=0;str[i]!='\0';i++)
{
//it will convert uppercase to lowercase
if(str[i]>=65 && str[i]<=90)
{
str[i]=str[i]+32;
}
}
printf(" %s",str);
}
enter a string:WELCOME TO MY WEBSITE welcome to my website
str
a-A=32
A+32=a i.e 65+32=97