WAP to convert the string from lower case to upper case


C Program to convert the string from lower case to upper case.


#include <stdio.h>
#define MAX_SIZE 100 //Maximum size of the string
int main()
{
    char string[MAX_SIZE];
    int i;
    printf("Enter your text : ");
    gets(string);
    for(i=0; string[i]!='\0'; i++)
    {
        if(string[i]>='a' && string[i]<='z')
        {
            string[i] = string[i]-32;
        }
    }

    printf("Uppercase string : %s\n",string);
    return 0;
}

Disqus Comments