Wednesday, October 31, 2018

STRING: PROGRAM TO CHANGE LOWER CASE CHARACTER TO UPPER AND VICE VERSA

#include<stdio.h>
void main()
{
char str[30];
int i;
printf("Enter the string:");
gets(str);
for(i=0;str[i]!='\0';i++)
{
if(str[i]>='A'&&str[i]<='Z')
{
str[i]=str[i]+32;
}
else
{
str[i]=str[i]-32;
}
}
printf("after manipulation of string:");
puts(str);
}

No comments:

Post a Comment

Static Member Function

CODE : #include<iostream> using namespace std; class test  {     int code;       static int count;               //static...