Forums.Sureshkumar.net : A Perfect Place to Share Knowledge         Blogs     Games    Magazines    

"Sharing knowledge does not lessen your store, often it gets you more. Sharing plays a key role in relationships and bonding, happens in small steps and is assisted through community membership."

Go Back   SURESHKUMAR.NET FORUMS > TECHNICAL DISCUSSIONS > DATA STRUCTURES, C, C++, VC ++ > ds. c , c++ Interview / Technical Questions
Register FAQ Members List Calendar Games Blogs Search Today's Posts Mark Forums Read

ds. c , c++ Interview / Technical Questions Kindly solve an many as questions you can. It will sharpen your skills and those solutions will help others too.

   

Reply
 
LinkBack Thread Tools Rate Thread Display Modes
Old 14-05-07, 04:23 PM   #1 (permalink)
Senior Member
 
Join Date: Oct 2006
Location: In Bangalore
Age: 24
Posts: 126
Thanks: 1
Thanked 6 Times in 6 Posts
Thanks: 1
Thanked 6 Times in 6 Posts
Rep Power: 0 jithendra.b will become famous soon enough
WAP to convert a lower case string to higher case and vice versa

WAP to convert a lower case string to higher case and vice versa
Sample I/P : hello
O/P : HELLO
jithendra.b is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 14-05-07, 04:24 PM   #2 (permalink)
Senior Member
 
Join Date: Oct 2006
Location: In Bangalore
Age: 24
Posts: 126
Thanks: 1
Thanked 6 Times in 6 Posts
Thanks: 1
Thanked 6 Times in 6 Posts
Rep Power: 0 jithendra.b will become famous soon enough
Re: WAP to convert a lower case string to higher case and vice versa

#include<stdio.h>
int cap_small(char *);
int main()
{
char str[] = "hello";
cap_small(str);
printf("%s\n",str);
}
int cap_small(char *ptr)
{
while(*ptr != '\0')
{
*ptr = *ptr - ('a' - 'A');
*ptr++;
}

}
~
jithendra.b is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 03-07-07, 07:38 PM   #3 (permalink)
Junior Member
 
Join Date: Jul 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 2 ajayyadavmca is on a distinguished road
Re: WAP to convert a lower case string to higher case and vice versa

may be better and fast.
if you XOR each character one by one by 32. it converts vice versa.
Ex:- char p[]={ChAiR};
while(p)
{
p[i]=p[i]^32;
}
ajayyadavmca is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT +6.5. The time now is 05:01 AM.





Search Engine Optimization by vBSEO 3.1.0