Convert string in uppercase to lowercase without using library function

C program to convert string in uppercase to lowercase without using library function.

Program

#include<stdio.h>
#include<conio.h>
#define MAX 50

void main()
{
	char str[MAX];
    int i;

    printf("Enter the string in UPPERCASE\t:");
    gets(str);

    i = 0;
    while(str[i] != '\0')
    {
        if(str[i]>=65 && str[i]<=92)
            str[i] = str[i] + 32;
        i++;
    }

    printf("\nString in lowercase is\t:%s",str);

    getch();
}

Output

Enter the string in UPPERCASE   :WELCOME TO COURSECRUX.COM

String in lowercase is  :welcome to coursecrux.com