CODE BOX
Pages
Home
Data Types
Algorithms
Easy Find
Linux Commands
Sunday, 4 October 2015
WAP convert upper letter to lower & lower letter to upper.
CODE ::
#include <stdio.h>
int main ()
{
char a[1000];
int i;
printf("Enter a sentence: ");
gets(a);
for(i=0;i<a[i];i++)
{
if(a[i]>='A'&&a[i]<='Z')
printf("%c",a[i]-'A'+'a');
else
printf("%c",a[i]-'a'+'A');
}
return 0;
}
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment