Get Email Subscription

Enter your email address:

Delivered by FeedBurner

Tuesday, April 20, 2010

The following program converts UPPERCASE string to lowercase. (c++)


The foloowing program converts UPPERCASE string to lowercase.(c++)
 
#include< iostream.h> 
#include< string.h> 
void StrToLwr(char* mainstring, char *output)
 
    {
 
    int Len = strlen(mainstring);  
 
    for(int i = 0; i < Len; i++) 
 
        {
 
        if( (int)mainstring[i] < 65) 
 
        output[i] = mainstring[i];
 
        if( (int)mainstring[i] >= 65 && (int)mainstring[i] <= 90) 
        output[i] = (char)mainstring[i] + 32;
 
        if( (int)mainstring[i] >= 97 && (int)mainstring[i] <= 122) 
        output[i] = (char)mainstring[i];
 
        if( (int)mainstring[i] > 122) 
        output[i] = mainstring[i];
 
    }
 
    output[i] = '\0'; 
}
 
 
//main program
void main()
 
{
 
char arr1[21]="PRAsHANT";
 
char arr2[21]; 
StrToLwr(arr1,arr2); 
 
cout < < arr2; 
 
}

Related Posts by Categories



0 comments:

About This Blog

Lorem Ipsum

  © Blogger templates Newspaper III by Ourblogtemplates.com 2008

Back to TOP