Skip to main content

Featured

functions in Python

c++ program to convert lowercase to uppercase and vice versa

//Following Program accepts a String and then converts lowercase characters to uppercase and vice versa.
#include<iostream.h>
#include<stdio.h>
void main()
{

char str[100];
cout<<"\nEnter A String\n";
gets(str);
for(int i=0;str[i]!='\0';++i)
 {
  if(str[i]>=65&&str[i]<=90)
{
str[i]+=32;
}
  else if(str[i]>=97&&str[i]<=122)
{
str[i]-=32;
}
 }
 cout<<"\nConverted String is : "<<str;
}

OUTPUT:

Comments

Popular Posts