Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

How to convert lowercase letters to uppercase and uppercase letters to lowercase in a string. (ex, AbcdEfG should convert as aBCDeFg)

Answer Posted / agrawal_vivek

easiest way is to use the condition-

for(i=0;s[i]!='';i++)
{
if(s[i]>=65 && s[i]<=90) //Caps ASCII-65-90(60+32=97-----90+32=122)
s[i]=s[i]+32;

if(s[i]>=97 && s[i]<=122) // Small ASCII-97-122(97-32=65-----122-32=90)
s[i]=s[i]-32;
}

Is This Answer Correct ?    3 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain the difference between cursor declared in procedures and cursors declared in the package specification?

1225


Is primary key always clustered index?

1066


what is auto increment? : Sql dba

1051


What are the datatypes available in pl/sql ?

1155


How many types of triggers exist in pl/sql?

1137


What is cross join example?

1067


Why do we use procedures in sql?

1141


What type of join is sql join?

1024


Explain the rollback statement?

1072


how to use regular expression in pattern match conditions? : Sql dba

1089


What is sap sql anywhere?

1168


What are different functions in sql?

998


What are functions in sql?

997


how to delete an existing column in a table? : Sql dba

1063


What is java sql package?

1145