C program to convert string lower case to uppercase using Loop and pointer.
C program to convert string lower case to uppercase using Loop and pointer.
#include <stdio.h>
#define MAX 100
int main()
{
char text[MAX];
char * st = text;
/* Input string from user */
printf("Enter any string : ");
gets(text);
while(*st)
{
*st = (*st > 'a' && *st <= 'z') ? *st-32 : *st;
st++;
}
printf("\n to convert lower case to Uppercase string : %s",text);
return 0;
}
Output:
Enter your text : Language
to convert lower case to Uppercase string : LANGUAGE