C program to convert string to uppercase without using inbuilt functions
PROGRAM:
#include <stdio.h>int main()
{
char str[50];
int i=0;
printf("Enter a string to be converted to uppercase\n");
scanf("%s",str);
printf("Entered string is %s\n",str);
while(str[i]!='\0')
{
if(str[i]>='a'&&str[i]<='z')
{
str[i]=str[i]-32;
}
i++;
}
printf("String converted to uppercase: %s\n",str);
return 0;
}
OUTPUT:
Enter a string to be converted to uppercaseWork.is.Worship
Entered string is Work.is.Worship
String converted to uppercase: WORK.IS.WORSHIP