convert lower to upper case

string conversion:

 Here is the code of convert lower case string to upper case in the c programming language. The concept of ASCII involves in the conversion of string.  



#define size 100

  void convet1st2Capital(char str[]);

int main(void){

char str[size];

printf("Enter the string to capitalize initials:\n");




void convet1st2Capital(char str[]){

int s = 0;

while (!(str[s] == '\0')){

if (str[s] >= 'a' && str[s] <= 'z'){

str[s] -= 32;





printf("%s", str);




In this example,declare the global variable for size of character array and function to convert the lower case string to upper case string .

In the function, the loop is used to check the lower case character and convert into the upper by subtracting the 32 in the character ASCII.In the last,display the string .


Hire a programmer

Popular posts from this blog

CSS selector

C program to convert decimal to binary number

C Program to convert binary to decimal number