Problem Description
program to convert upper case to lower case and lower case to upper caseCODING ARENA
#include <stdio.h>
#include<string.h>
int main()
{
char str[20];
int i;
scanf("%s",str);
for(i=0;i<strlen(str);i++)
{
if(str[i]>=65&&str[i]<=90)
{
str[i]=str[i]+32;
}
else if(str[i]>=97&&str[i]<=122)
{
str[i]=str[i]-32;
}
}
printf("%s",str);
return 0;
}
Test Case 1
Input (stdin)hai
Expected OutputHAI
Test Case 2
Input (stdin)HAI
Expected Outputhai
No comments:
Post a Comment