My photo
Bangalore, Karnataka, India
Extending one hand to help someone has more value rather than joining two hands for prayer

Archives

program to toogle a string

Tuesday, September 1, 2009

#include<iostream.h>
#include<conio.h>
void main()
{  clrscr();
   char s[50];
   cout<<"enter the string:"<<endl;
   cin>>s;
   int i=0;
   while(s[i]!='\0')
   {  if(s[i]>=65&&s[i]<=90)
      s[i]=s[i]+32;
      else
      s[i]=s[i]-32;
      i++;        }
   cout<<"string in toggle is:"<<endl;
   cout<<s;
   getch();
   }

0 comments: