In this string lower in C without strlwr function example, First printf statement will ask the user to enter any name or string, and the user specified string will be assigned to character array str[100].

printf("\n Please Enter a string to convert it into Lowercase\n");
gets(str);

Following statement will call the function void String_Lower(char string[])

String_Lower(str);

For every string, the special character \0 is automatically added to the end, it acts as marking where string will end. So in the while loop, we check for the same:

while (string[i] != '\0')

While loop will continue iterating until it reaches the special character \0. Once it reached then, the loop will be terminated.

In the next line, we used the If Statement to check whether the character is between ‘A’ and ‘Z’, and if the condition is True we are adding 32 to existing ASCII value. This is because ASCII value of A is 65, and a is 97. In order to convert a to A, we are adding 32 to it.

Next line, we are increment the value of i.

TIP: Please refer ASCII Table article to understand the list of ASCII Character and their decimal, Hexadecimal and Octal numbers.