Convert string in lowercase to uppercase without using library function
C program to convert string in lowercase to uppercase 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 lowercase\t:");
gets(str);
i = 0;
while(str[i] != '\0')
{
if(str[i]>=97 && str[i]<=122)
str[i] = str[i] - 32;
i++;
}
printf("\nString in uppercase is\t:%s",str);
getch();
}
Output
Enter the string in lowercase :welcome to coursecrux.com
String in uppercase is :WELCOME TO COURSECRUX.COM