My Subject Blog

C Program Upper to Lower and Lower to Upper Case

/* 
Write a C Program to Conver all Character of String from upper to lower and lower to upper case. 
*/

#include <stdio.h>
int main(void) 
{
char str[20]="aBcDeF";
int i=0;
while(str[i]!='\0')
{
str[i]=str[i]^32;
                //Above Logic will convert character upper to Lower and lower to upper
i++;
}
printf("Changed String : %s",str);
return 0;
}

Comments

Most Visited Post

C Program to Find Largest Odd Number from Array

C Program for Memory Allocation and Reallocation

C Program for Runtime Memory Allocation for Table of Integers

Followers