/*
* A function that takes a charachter by value . It checks the ASCII value of the charchter
* . It manipulates the ASCII values only when the passed charachter is upper case .
* For detail of ASCII values see here -> http://www.asciitable.com/
*/
char lower(char ch){
if(ch >= 65 && ch <=90)
{ ch=ch+32;
}
return ch;
}
int main(int argc, char** argv) {
char str[50];
int i,l;
printf("Enter the string to covert ");
scanf("%s",str);
/*
Get the length of the string that the user inputs
*/
l=strlen(str);
/*
* Loop over every characters in the string . Send it to a function called
* lower . The function takes each character by value .
*/
for(i=0;i<l;i++)
str[i]=lower(str[i]);
/*
* Print the new string
*/
printf("The changes string is %s",str);
return 0;
}